From kde-commits Sat Apr 24 19:27:23 2010 From: Hugo Pereira Da Costa Date: Sat, 24 Apr 2010 19:27:23 +0000 To: kde-commits Subject: KDE/kdebase/workspace/kstyles/oxygen Message-Id: <20100424192723.0B182AC8A2 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=127213705816254 SVN commit 1118446 by hpereiradacosta: fixed double painting of the shadow for non-autoraise toolbuttons M +5 -6 oxygen.cpp --- trunk/KDE/kdebase/workspace/kstyles/oxygen/oxygen.cpp #1118445:1118446 @@ -376,13 +376,15 @@ if( !widget ) return false; - // handle inactive (but animated) toolbuttons - //Extract the stuff we need out of the option + // check autoRaise state State flags( option->state ); + bool isInToolBar( widget->parent() && widget->parent()->inherits( "QToolBar" ) ); + if( !( isInToolBar || (flags & State_AutoRaise) ) ) return false; + + // get rect and palette QRect rect( option->rect ); QPalette palette( option->palette ); - // local clone of toolbutton option const QStyleOptionToolButton *tbOption( qstyleoption_cast(option) ); if( !tbOption ) return false; @@ -390,8 +392,6 @@ // make local copy QStyleOptionToolButton localTbOption(*tbOption); - bool isInToolBar( widget->parent() && widget->parent()->inherits( "QToolBar" ) ); - const bool enabled = flags & State_Enabled; const bool mouseOver(enabled && (flags & State_MouseOver)); const bool hasFocus(enabled && (flags&State_HasFocus)); @@ -424,7 +424,6 @@ if( enabled && !(mouseOver || hasFocus || sunken ) ) { - //if( hoverAnimated || (focusAnimated && !hasFocus) ) if( hoverAnimated || (focusAnimated && !hasFocus) || ( ((toolBarAnimated && animatedRect.isNull())||toolBarTimerActive) && current ) ) { QRect buttonRect = subControlRect(CC_ToolButton, option, SC_ToolButton, widget);