From kde-commits Sat Oct 31 23:53:54 2009 From: Hugo Pereira Da Costa Date: Sat, 31 Oct 2009 23:53:54 +0000 To: kde-commits Subject: branches/work/oxygen-style-animated Message-Id: <1257033234.281730.26550.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125703324422806 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(kOpt); - QColor arrowColor = colorOpt->color.color(pal); + KStyle::ColorOption* colorOpt = extractOption(kOpt); + QColor color = colorOpt->color.color(pal); + QColor background = pal.color(QPalette::Window); // customize color depending on widget if (qobject_cast(widget) ) { // spinBox - arrowColor = pal.color( QPalette::Text ); + color = pal.color( QPalette::Text ); + background = pal.color( QPalette::Background ); } else if(const QScrollBar* scrollbar = qobject_cast(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(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();