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

List:       kde-commits
Subject:    branches/work/oxygen-style-animated
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2009-10-31 23:53:54
Message-ID: 1257033234.281730.26550.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1043184 by hpereiradacosta:

fixed color roles for arrows

 M  +28 -11    oxygen.cpp  


--- branches/work/oxygen-style-animated/oxygen.cpp #1043183:1043184
@@ -2656,14 +2656,16 @@
             }
 
             qreal penThickness = 1.6;
-            KStyle::ColorOption* colorOpt   = \
                extractOption<KStyle::ColorOption*>(kOpt);
-            QColor  arrowColor = colorOpt->color.color(pal);
+            KStyle::ColorOption* colorOpt = \
extractOption<KStyle::ColorOption*>(kOpt); +            QColor color = \
colorOpt->color.color(pal); +            QColor background = \
pal.color(QPalette::Window);  
             // customize color depending on widget
             if (qobject_cast<const QSpinBox *>(widget) )
             {
                 // spinBox
-                arrowColor = pal.color( QPalette::Text );
+                color = pal.color( QPalette::Text );
+                background = pal.color( QPalette::Background );
 
             } else if(const QScrollBar* scrollbar = qobject_cast<const \
QScrollBar*>(widget) ) {  
@@ -2700,11 +2702,11 @@
 
                         if( animated )
                         {
-                            arrowColor = KColorUtils::mix( arrowColor, highlight, \
opacity ); +                            color = KColorUtils::mix( color, highlight, \
opacity );  
                         } else if( hover ) {
 
-                            arrowColor = highlight;
+                            color = highlight;
 
                         }
 
@@ -2721,7 +2723,8 @@
                     if(!tool->autoRaise())
                     {
 
-                        arrowColor = pal.color( QPalette::ButtonText );
+                        color = pal.color( QPalette::ButtonText );
+                        background = pal.color( QPalette::Button );
                         if ((flags & State_On) || (flags & State_Sunken)) opts |= \
Sunken;  if (flags & State_HasFocus) opts |= Focus;
                         if (enabled && (flags & State_MouseOver)) opts |= Hover;
@@ -2743,16 +2746,16 @@
 
                     } else {
 
-                        if ((flags & State_On) || (flags & State_Sunken)) arrowColor \
                = pal.color( QPalette::Highlight );
-                        else arrowColor = pal.color( QPalette::WindowText );
+                        if ((flags & State_On) || (flags & State_Sunken)) color = \
pal.color( QPalette::Highlight ); +                        else color = pal.color( \
QPalette::WindowText );  
                     }
 
                 } else {
 
                     // adjust color
-                    if ((flags & State_On) || (flags & State_Sunken)) arrowColor = \
                pal.color( QPalette::Highlight );
-                    else arrowColor = pal.color( QPalette::WindowText );
+                    if ((flags & State_On) || (flags & State_Sunken)) color = \
pal.color( QPalette::Highlight ); +                    else color = pal.color( \
QPalette::WindowText );  
                     // smaller down arrow for menu indication on toolbuttons
                     penThickness = 1.4;
@@ -2782,6 +2785,20 @@
                         default: break;
                     }
                 }
+            } else if( const QComboBox *comboBox = qobject_cast<const QComboBox \
*>(widget) ){ +
+                if( comboBox->editable() )
+                {
+                    color = pal.color( QPalette::Text );
+                    background = pal.color( QPalette::Background );
+
+                } else {
+
+                    color = pal.color( QPalette::ButtonText );
+                    background = pal.color( QPalette::Button );
+
+                }
+
             }
 
             // white reflection
@@ -2792,7 +2809,7 @@
             p->drawPolyline(a);
             p->translate(0,-penThickness);
 
-            p->setPen(QPen( _helper.decoColor( pal.color(QPalette::Window), \
arrowColor ) , penThickness, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); +          \
p->setPen(QPen( _helper.decoColor( background, color ) , penThickness, Qt::SolidLine, \
Qt::RoundCap, Qt::RoundJoin));  p->drawPolyline(a);
 
             p->restore();


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

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