diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -239,27 +239,26 @@ QColor Helper::buttonBackgroundColor( const QPalette& palette, bool mouseOver, bool hasFocus, bool sunken, qreal opacity, AnimationMode mode ) const { - QColor background( sunken ? - KColorUtils::mix( palette.color( QPalette::Button ), palette.color( QPalette::ButtonText ), 0.2 ): - palette.color( QPalette::Button ) ); - - if( mode == AnimationHover ) - { + const QColor sunkenColor( KColorUtils::mix( palette.color( QPalette::Button ), palette.color( QPalette::ButtonText ), 0.2 ) ); + QColor background( sunken ? sunkenColor : palette.color( QPalette::Button ) ); + + if( mode == AnimationHover ) { const QColor focus( focusColor( palette ) ); const QColor hover( hoverColor( palette ) ); - if( hasFocus ) background = KColorUtils::mix( focus, hover, opacity ); + if( hasFocus && !sunken ) background = KColorUtils::mix( focus, hover, opacity ); + else if( sunken ) background = KColorUtils::mix( sunkenColor, hover, opacity ); - } else if( mouseOver && hasFocus ) { + } else if( mouseOver && ( hasFocus || sunken ) ) { background = hoverColor( palette ); - } else if( mode == AnimationFocus ) { + } else if( mode == AnimationFocus && !sunken ) { const QColor focus( focusColor( palette ) ); background = KColorUtils::mix( background, focus, opacity ); - } else if( hasFocus ) { + } else if( hasFocus && !sunken ) { background = focusColor( palette );