[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kwin/clients/b2
From:       Luciano Montanaro <mikelima () cirulla ! net>
Date:       2004-07-03 10:35:13
Message-ID: 20040703103513.C992799E9 () office ! kde ! org
[Download RAW message or body]

CVS commit by montanaro: 

Added updateGeometry() for the titlebar when initialixing the decoration.
Seems to fix the initial titlebar size calculation.


  M +6 -4      b2client.cpp   1.78


--- kdebase/kwin/clients/b2/b2client.cpp  #1.77:1.78
@@ -382,5 +382,5 @@ void B2Client::init()
 
     titlebar = new B2Titlebar(this);
-    titlebar->setMinimumWidth(16);
+    titlebar->setMinimumWidth(buttonSize + 4);
     titlebar->setFixedHeight(buttonSize + 4);
 
@@ -404,8 +404,10 @@ void B2Client::init()
         color(QColorGroup::Button);
 
-    for (int i = 0; i < BtnCount; i++)
+    for (int i = 0; i < BtnCount; i++) {
         if (button[i])
             button[i]->setBg(c);
+    }
 
+    titlebar->updateGeometry();
     positionButtons();
     titlebar->recalcBuffer();
@@ -703,4 +705,5 @@ void B2Client::showEvent(QShowEvent *)
 {
     calcHiddenButtons();
+    positionButtons();
     doShape();
     widget()->repaint();
@@ -1254,5 +1257,5 @@ B2Titlebar::B2Titlebar(B2Client *parent)
 {
     setBackgroundMode(NoBackground);
-    captionSpacer = new QSpacerItem(10, buttonSize + 4,
+    captionSpacer = new QSpacerItem(buttonSize, buttonSize + 4,
             QSizePolicy::Expanding, QSizePolicy::Fixed);
 }
@@ -1316,5 +1319,4 @@ void B2Titlebar::drawTitlebar(QPainter &
 void B2Titlebar::recalcBuffer()
 {
-    QFontMetrics fm(options()->font(true));
     titleBuffer.resize(width(), height());
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic