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

List:       kde-commits
Subject:    kdebase/kwin/clients/plastik
From:       Sandro Giessl <sandro () giessl ! com>
Date:       2005-03-19 16:01:36
Message-ID: 20050319160136.7106B1763F () office ! kde ! org
[Download RAW message or body]

CVS commit by giessl: 

minor titlebar edge cleanup
remove the ShadowEngine... it is just too slow and even makes e.g. kmail feel
slower when dragging messages over the folder list. have a bogus shadow
instead (various drawText calls with blended colors) which also looks quite nice and
is twice as fast. Still no kwin decoration seems to feel as fast as metacity when it
comes to caption changes such as in the kmail example... This is something that should
be looked into IMHO.


  M +14 -26    plastikclient.cpp   1.44


--- kdebase/kwin/clients/plastik/plastikclient.cpp  #1.43:1.44
@@ -39,5 +39,4 @@
 #include "plastikbutton.h"
 #include "misc.h"
-#include "shadow.h"
 
 namespace KWinPlastik
@@ -329,18 +328,10 @@ void PlastikClient::paintEvent(QPaintEve
     {
         painter.setPen(highlightTop );
-        painter.drawLine(r_x+3, r_y+1, r_x2-3, r_y+1 );
-        // a bit anti-aliasing for the window contour...
-        painter.setPen(alphaBlendColors(highlightTop, windowContour, 150) );
-        painter.drawPoint(r_x+2, r_y+1);
-        painter.drawPoint(r_x2-2, r_y+1);
-        painter.setPen(alphaBlendColors(highlightTitleLeft, windowContour, 150) );
-        painter.drawPoint(r_x+1, r_y+2);
-        painter.setPen(alphaBlendColors(highlightTitleRight, windowContour, 150) );
-        painter.drawPoint(r_x2-1, r_y+2);
+        painter.drawLine(r_x+2, r_y+1, r_x2-2, r_y+1 );
         // highlight...
         painter.setPen(highlightTitleLeft);
-        painter.drawLine(r_x+1, r_y+3, r_x+1, titleEdgeTopBottom );
+        painter.drawLine(r_x+1, r_y+2, r_x+1, titleEdgeTopBottom );
         painter.setPen(highlightTitleRight);
-        painter.drawLine(r_x2-1, r_y+3, r_x2-1, titleEdgeTopBottom );
+        painter.drawLine(r_x2-1, r_y+2, r_x2-1, titleEdgeTopBottom );
 
         tempRect.setRect(r_x+2, r_y+2, r_w-2*2, titleEdgeTop-2 );
@@ -613,15 +604,4 @@ const QPixmap &PlastikClient::captionPix
 
     const int thickness = 2;
-    QPixmap textPixmap(captionWidth+2*thickness, captionHeight+2*thickness);
-    if(Handler()->titleShadow()) {
-        textPixmap.fill(QColor(0,0,0) );
-
-        painter.begin(&textPixmap);
-        painter.setFont(s_titleFont);
-        painter.setPen(Qt::white);
-        painter.drawText(textPixmap.rect(), AlignCenter, c );
-
-        painter.end();
-    }
 
     QPixmap *captionPixmap = new QPixmap(captionWidth+2*thickness, th);
@@ -630,4 +610,7 @@ const QPixmap &PlastikClient::captionPix
     painter.drawTiledPixmap(captionPixmap->rect(),
                             Handler()->pixmap(TitleBarTile, active, isToolWindow()) );
+
+    painter.setFont(s_titleFont);
+    QPoint tp(1, captionHeight-1);
     if(Handler()->titleShadow())
     {
@@ -637,9 +620,14 @@ const QPixmap &PlastikClient::captionPix
         else
             shadowColor = QColor(0,0,0);
-        paintShadow(&painter, textPixmap, 0,1, thickness, shadowColor);
+
+        painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 205) );
+        painter.drawText(tp+QPoint(1,2), c);
+        painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 225) );
+        painter.drawText(tp+QPoint(2,2), c);
+        painter.setPen(alphaBlendColors(options()->color(ColorTitleBar, active), shadowColor, 165) );
+        painter.drawText(tp+QPoint(1,1), c);
     }
-    painter.setFont(s_titleFont);
     painter.setPen(Handler()->getColor(TitleFont,active) );
-    painter.drawText(captionPixmap->rect(), AlignCenter, c );
+    painter.drawText(tp, c );
     painter.end();
 


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

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