diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp index e487bef0..20bcee39 100644 --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -226,7 +226,8 @@ namespace Breeze } //____________________________________________________________________ - QColor Helper::toolButtonColor( const QPalette& palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode ) const + // QColor Helper::toolButtonColor( const QPalette& palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode ) const + QColor Helper::toolButtonColor( const QPalette& palette, bool mouseOver, bool hasFocus, bool sunken, qreal opacity, AnimationMode mode ) const { QColor outline; @@ -237,7 +238,7 @@ namespace Breeze const QColor hover( hoverColor( palette ) ); const QColor focus( focusColor( palette ) ); - if( hasFocus ) outline = KColorUtils::mix( focus, hover, opacity ); + if( hasFocus || sunken ) outline = KColorUtils::mix( focus, hover, opacity ); else outline = alphaColor( hover, opacity ); } else if( mouseOver ) { @@ -247,9 +248,10 @@ namespace Breeze } else if( mode == AnimationFocus ) { const QColor focus( focusColor( palette ) ); - outline = alphaColor( focus, opacity ); + if( sunken ) outline = focus; + else outline = alphaColor( focus, opacity ); - } else if( hasFocus ) { + } else if( hasFocus || sunken ) { outline = focusColor( palette ); diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h index 33b5261e..3ea3030f 100644 --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -123,7 +123,7 @@ namespace Breeze QColor buttonBackgroundColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; //* tool button color - QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; + QColor toolButtonColor( const QPalette&, bool mouseOver, bool hasFocus, bool sunken, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; //* slider outline color, using animations QColor sliderOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity = AnimationData::OpacityInvalid, AnimationMode = AnimationNone ) const; diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index f1120e39..abf99f8e 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -2954,7 +2954,7 @@ namespace Breeze // define colors and render const QPalette& palette( option->palette ); - const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus || sunken, opacity, mode ) ); + const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); _helper->renderToolButtonFrame( painter, rect, color, sunken ); } else { @@ -3027,7 +3027,7 @@ namespace Breeze } else { - const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus || sunken, opacity, mode ) ); + const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); _helper->renderToolButtonFrame( painter, rect, color, sunken ); } @@ -5320,7 +5320,7 @@ namespace Breeze if( flat ) { // define colors and render - const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus || sunken, opacity, mode ) ); + const QColor color( _helper->toolButtonColor( palette, mouseOver, hasFocus, sunken, opacity, mode ) ); _helper->renderToolButtonFrame( painter, rect, color, sunken ); } else {