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

List:       kde-commits
Subject:    kdeplayground-artwork/plastik2/qt4style
From:       Sandro Giessl <sandro () giessl ! com>
Date:       2005-02-12 11:16:50
Message-ID: 20050212111650.D87DB1D016 () office ! kde ! org
[Download RAW message or body]

CVS commit by giessl: 

fix arrows


  M +31 -45    qt4plastik.cpp   1.10
  M +0 -5      qt4plastik.h   1.7


--- kdeplayground-artwork/plastik2/qt4style/qt4plastik.cpp  #1.9:1.10
@@ -974,35 +974,33 @@ void Plastik2Style::drawPrimitive (Primi
         case PE_IndicatorArrowLeft:
         {
-            QPolygon a;
+            const QMatrix oldMatrix( p->matrix() );
 
-            switch (pe) {
+            p->translate((r.x()+r.width()/2), (r.y()+r.height()/2));
+
+            p->setPen(pal.buttonText().color() );
+
+            bool up = true;
+
+            switch (pe)
+            {
                 case PE_IndicatorSpinUp:
-                case PE_IndicatorArrowUp: {
-                    a.setPoints(9, u_arrow);
+                case PE_IndicatorArrowUp:
+                    up = true;
                     break;
-                }
                 case PE_IndicatorSpinDown:
-                case PE_IndicatorArrowDown: {
-                    a.setPoints(9, d_arrow);
+                case PE_IndicatorArrowDown:
+                    up = false;
                     break;
-                }
-                case PE_IndicatorArrowLeft: {
-                    a.setPoints(9, l_arrow);
+                case PE_IndicatorArrowRight:
+                    up = true;
+                    p->rotate(90);
                     break;
-                }
-                case PE_IndicatorArrowRight: {
-                    a.setPoints(9, r_arrow);
+                case PE_IndicatorArrowLeft:
+                    up = false;
+                    p->rotate(90);
+                    break;
+                default:
                     break;
                 }
-                default: {
-                    if (state & State_Up) {
-                        a.setPoints(9, u_arrow);
-                    } else {
-                        a.setPoints(9, d_arrow);
-                    }
-                }
-            }
-
-            const QMatrix oldMatrix( p->matrix() );
 
             if (state & State_Down) {
@@ -1011,28 +1009,16 @@ void Plastik2Style::drawPrimitive (Primi
             }
 
-            a.translate((r.x()+r.width()/2), (r.y()+r.height()/2));
-            // extra-pixel-shift, correcting some visual tics...
-            switch(pe) {
-                case PE_IndicatorArrowLeft:
-                case PE_IndicatorArrowRight:
-                    a.translate(0, -1);
-                    break;
-                case PE_IndicatorSpinUp:
-                case PE_IndicatorSpinDown:
-                    a.translate(+1, 0);
-                    break;
-                default:
-                    a.translate(0, 0);
+            if (up) {
+                p->drawLine(-1,-2, 0,-2);
+                p->drawLine(-2,-1, 1,-1);
+                p->drawLine(-3,0, 2,0);
+                p->drawLine(-3,1, 2,1);
+            } else {
+                p->drawLine(-1,1, 0,1);
+                p->drawLine(-2,0, 1,0);
+                p->drawLine(-3,-1, 2,-1);
+                p->drawLine(-3,-2, 2,-2);
             }
 
-//             if (p->pen() == Qt::NoPen) {
-//                 if (state & State_Enabled) {
-                    p->setPen(pal.buttonText().color() );
-//                 } else {
-//                     p->setPen(pal.highlightedText().color() );
-//                 }
-//             }
-            p->drawPolygon(a);
-
             p->setMatrix( oldMatrix );
 

--- kdeplayground-artwork/plastik2/qt4style/qt4plastik.h  #1.6:1.7
@@ -26,9 +26,4 @@
 #include <QMap>
 
-#define u_arrow -1,-2, 0,-2,  -2,-1, 1,-1,  -3,0, 2,0,  -3,1, 2,1
-#define d_arrow -1,1, 0,1,  -2,0, 1,0,  -3,-1, 2,-1,  -3,-2, 2,-2
-#define l_arrow -2,0, -2,1,  -1,-1, -1,2,  0,-2, 0,3,  1,-2, 1,3
-#define r_arrow 1,0, 1,1,  0,-1, 0,2,  -1,-2, -1,3,  -2,-2, -2,3
-
 #define DRAW_BITMAP( painter, pos_x, pos_y, color, bitmapname ) \
 { \


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

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