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

List:       kde-commits
Subject:    kdeartwork/kwin-styles/kstep
From:       Luciano Montanaro <mikelima () virgilio ! it>
Date:       2003-09-17 13:39:05
[Download RAW message or body]

CVS commit by montanaro: 

Fixed resize issues (the title bar was not updated after a resize)


  M +32 -16    nextclient.cpp   1.30


--- kdeartwork/kwin-styles/kstep/nextclient.cpp  #1.29:1.30
@@ -481,5 +481,7 @@ void NextClient::maximizeButtonClicked()
 void NextClient::resizeEvent(QResizeEvent *)
 {
-    if (widget()->isVisibleToTLW() /*&& !widget()->testWFlags(WStaticContents)*/) {
+#if 0
+    // This code is useless in the new API.
+    if (widget()->isVisibleToTLW() && !widget()->testWFlags(WStaticContents)) {
         QPainter p(widget());
         QRect t = titlebar->geometry();
@@ -490,4 +492,8 @@ void NextClient::resizeEvent(QResizeEven
         p.eraseRect(widget()->rect());
     }
+#endif
+    // The code below is required instead.
+    if (widget()->isVisible()) 
+        widget()->update(titlebar->geometry());
 }
 
@@ -501,8 +507,11 @@ void NextClient::paintEvent( QPaintEvent
 {
     QPainter p(widget());
+
+    // Draw black frame
     QRect fr = widget()->rect();
     p.setPen(Qt::black);
     p.drawRect(fr);
 
+    // Draw title bar
     QRect t = titlebar->geometry();
     t.setTop(1);
@@ -526,19 +535,24 @@ void NextClient::paintEvent( QPaintEvent
     p.drawText( t, AlignCenter | AlignVCenter, caption() );
 
-
+    // Draw resize handle
+    if (isResizable()) {
     qDrawShadePanel(&p, fr.x()+1, fr.bottom()-6, 24, 6,
-                    options()->colorGroup(KDecoration::ColorHandle, isActive()), false);
+                        options()->colorGroup(KDecoration::ColorHandle, 
+                            isActive()), false);
     p.drawTiledPixmap(fr.x()+2, fr.bottom()-5, 22, 4,
                       isActive() ? *aHandlePix : *iHandlePix);
 
     qDrawShadePanel(&p, fr.x()+25, fr.bottom()-6, fr.width()-50, 6,
-                    options()->colorGroup(KDecoration::ColorFrame, isActive()), false);
+                        options()->colorGroup(KDecoration::ColorFrame, 
+                            isActive()), false);
     p.drawTiledPixmap(fr.x()+26, fr.bottom()-5, fr.width()-52, 4,
                       isActive() ? *aFramePix : *iFramePix);
 
     qDrawShadePanel(&p, fr.right()-24, fr.bottom()-6, 24, 6,
-                    options()->colorGroup(KDecoration::ColorHandle, isActive()), false);
+                        options()->colorGroup(KDecoration::ColorHandle, 
+                            isActive()), false);
     p.drawTiledPixmap(fr.right()-23, fr.bottom()-5, 22, 4,
                       isActive() ? *aHandlePix : *iHandlePix);
+    }
 }
 
@@ -704,2 +718,4 @@ extern "C" KDecorationFactory* create_fa
 
 #include "nextclient.moc"
+
+// vim: sw=4


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

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