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

List:       kde-commits
Subject:    KDE/kdebase/runtime/kstyles/oxygen
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-02-05 23:36:35
Message-ID: 1265412995.897474.21366.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1085805 by hpereiradacosta:

use WidgetType rather than explicit cast to check on arrow visualization in \
drawGenericPrimitive. Shoud be more portable.

 M  +26 -17    oxygen.cpp  


--- trunk/KDE/kdebase/runtime/kstyles/oxygen/oxygen.cpp #1085804:1085805
@@ -550,7 +550,9 @@
         case CE_ComboBoxLabel:
         //same as CommonStyle, except for fiilling behind icon
         {
-            if (const QStyleOptionComboBox *cb = qstyleoption_cast<const \
QStyleOptionComboBox *>(option)) { +            if (const QStyleOptionComboBox *cb = \
qstyleoption_cast<const QStyleOptionComboBox *>(option)) +            {
+
                 QRect editRect = subControlRect(CC_ComboBox, cb, \
SC_ComboBoxEditField, widget);  p->save();
                 p->setClipRect(editRect);
@@ -3319,13 +3321,35 @@
             QColor background = pal.color(QPalette::Window);
 
             // customize color depending on widget
-            if( qobject_cast<const QSpinBox*>(widget) )
+            if( widgetType == WT_SpinBox )
             {
                 // spinBox
                 color = pal.color( QPalette::Text );
                 background = pal.color( QPalette::Background );
                 drawContrast = false;
 
+            } else if( widgetType == WT_ComboBox ) {
+
+                // combobox
+                if( const QStyleOptionComboBox *cb = qstyleoption_cast<const \
QStyleOptionComboBox *>(opt) ) +                {
+
+                    if( cb->editable )
+                    {
+
+                        color = pal.color( QPalette::Text );
+                        background = pal.color( QPalette::Background );
+                        if( enabled ) drawContrast = false;
+
+                    } else {
+
+                        color = pal.color( QPalette::ButtonText );
+                        background = pal.color( QPalette::Button );
+
+                    }
+
+                }
+
             } else if(const QScrollBar* scrollbar = qobject_cast<const \
QScrollBar*>(widget) ) {  
 
@@ -3450,22 +3474,7 @@
                         default: break;
                     }
                 }
-            } else if( const QComboBox *comboBox = qobject_cast<const QComboBox \
*>(widget) ){  
-                if( comboBox->isEditable() )
-                {
-
-                    color = pal.color( QPalette::Text );
-                    background = pal.color( QPalette::Background );
-                    if( comboBox->isEnabled() ) drawContrast = false;
-
-                } else {
-
-                    color = pal.color( QPalette::ButtonText );
-                    background = pal.color( QPalette::Button );
-
-                }
-
             }
 
             // white reflection


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

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