rev 10649 - branches/kde4/packages/kdebase-workspace/debian/patches

Armin Berres trigger-guest at alioth.debian.org
Mon May 19 21:19:10 UTC 2008


Author: trigger-guest
Date: 2008-05-19 21:19:09 +0000 (Mon, 19 May 2008)
New Revision: 10649

Modified:
   branches/kde4/packages/kdebase-workspace/debian/patches/22_icon_in_oxygen_title_bar.diff
Log:
update the sirl-in-title-bar-patch with input  sune. color is changing with the color scheme now and the drawing is still correct when the window is maximized

Modified: branches/kde4/packages/kdebase-workspace/debian/patches/22_icon_in_oxygen_title_bar.diff
===================================================================
--- branches/kde4/packages/kdebase-workspace/debian/patches/22_icon_in_oxygen_title_bar.diff	2008-05-19 14:27:47 UTC (rev 10648)
+++ branches/kde4/packages/kdebase-workspace/debian/patches/22_icon_in_oxygen_title_bar.diff	2008-05-19 21:19:09 UTC (rev 10649)
@@ -1,13 +1,3 @@
---- a/kwin/clients/oxygen/oxygenclient.h
-+++ b/kwin/clients/oxygen/oxygenclient.h
-@@ -56,6 +56,7 @@
-     QColor titlebarTextColor(const QPalette &palette);
-     bool colorCacheInvalid_;
-     QColor cachedTitlebarTextColor_;
-+    QImage logo;
- 
- protected:
-     friend class OxygenButton;
 --- a/kwin/clients/oxygen/oxygenclient.cpp
 +++ b/kwin/clients/oxygen/oxygenclient.cpp
 @@ -57,6 +57,9 @@
@@ -15,7 +5,7 @@
  #include "oxygen.h"
  
 +#define logourl "/usr/share/kde4/apps/kwin/titlebar_decor.png"
-+#define logoOffset 5
++#define logoOffset 9
 +
  namespace Oxygen
  {
@@ -28,25 +18,71 @@
  }
  
  OxygenClient::~OxygenClient()
-@@ -281,7 +285,7 @@
+@@ -237,9 +241,9 @@
+ }
+ 
+ 
+-QColor OxygenClient::titlebarTextColor(const QPalette &palette)
++QColor OxygenClient::titlebarTextColor(const QPalette &palette, bool active)
+ {
+-    if (isActive())
++    if (active)
+         return palette.color(QPalette::Active, QPalette::WindowText);
+     else {
+         if(colorCacheInvalid_) {
+@@ -255,6 +259,9 @@
+     }
+ }
+ 
++QColor OxygenClient::titlebarTextColor(const QPalette &palette) {
++    return titlebarTextColor(palette, isActive());
++}
+ 
+ void OxygenClient::paintEvent(QPaintEvent *e)
+ {
+@@ -280,12 +287,14 @@
+     const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft);
+     const int marginLeft = layoutMetric(LM_TitleBorderLeft);
+     const int marginRight = layoutMetric(LM_TitleBorderRight);
++    const int borderLeft = layoutMetric(LM_BorderLeft, true) + (layoutMetric(LM_BorderLeft, true) == 0 ? -1 : 0);
+ 
+     const int titleLeft = frame.left() + titleEdgeLeft + buttonsLeftWidth() + marginLeft;
++    const int fullLogoOffset = (logo.isNull() ? 0 : logo.width() + logoOffset - borderLeft);
      const int titleWidth = frame.width() -
              titleEdgeLeft - layoutMetric(LM_TitleEdgeRight) -
              buttonsLeftWidth() - buttonsRightWidth() -
 -            marginLeft - marginRight;
-+            marginLeft - marginRight - (logo.isNull() ? 0 : logo.width() + logoOffset);
++            marginLeft - marginRight - fullLogoOffset;
  
  
      int splitY = qMin(300, 3*frame.height()/4);
-@@ -313,6 +317,12 @@
+@@ -317,6 +326,15 @@
      painter.drawText(titleLeft, titleTop-1, titleWidth, titleHeight,  // -1 is to go into top resizearea
                OxygenFactory::titleAlign() | Qt::AlignVCenter, caption());
  
 +    if (!logo.isNull() && isActive()) {
++        QPixmap pix(logo.width(),logo.height());
++        pix.fill(titlebarTextColor(palette, false));
++        pix.setAlphaChannel(logo.alphaChannel());
 +        QFontMetrics fm(options()->font(isActive(), false));
-+        painter.drawImage(titleEdgeLeft + layoutMetric(LM_TitleEdgeRight) + buttonsLeftWidth()
-+         + qMin(fm.width(caption()), titleWidth) + logoOffset, titleTop, logo);
++        painter.drawPixmap(titleEdgeLeft + layoutMetric(LM_TitleEdgeRight) + buttonsLeftWidth()
++          + qMin(fm.width(caption()), titleWidth) + logoOffset - borderLeft, titleTop, pix);
 +    }
 +
      painter.setRenderHint(QPainter::Antialiasing);
  
      // Draw dividing line
+--- a/kwin/clients/oxygen/oxygenclient.h
++++ b/kwin/clients/oxygen/oxygenclient.h
+@@ -53,9 +53,11 @@
+ 
+ private:
+     void paintEvent(QPaintEvent *e);
++    QColor titlebarTextColor(const QPalette &palette, bool active);
+     QColor titlebarTextColor(const QPalette &palette);
+     bool colorCacheInvalid_;
+     QColor cachedTitlebarTextColor_;
++    QPixmap logo;
+ 
+ protected:
+     friend class OxygenButton;




More information about the pkg-kde-commits mailing list