Commit 51abf6a3 authored by David Redondo's avatar David Redondo 🏎
Browse files

Use correct colors for arrows in checked toolbuttons in toolbars

Seperate sunken and checked state. Use HighlightedText when the arrow is hovered
because it will a hover color tinted background.


(cherry picked from commit c61a78b0)
parent bf0f11e6
......@@ -3404,16 +3404,22 @@ namespace Breeze
// cast option
const QStyleOptionToolButton* toolButtonOption( static_cast<const QStyleOptionToolButton*>( option ) );
const auto menuStyle = BreezePrivate::toolButtonMenuArrowStyle( toolButtonOption );
const bool sunken( state & (State_On | State_Sunken) );
const bool sunken = state & State_Sunken;
const bool checked = state & State_On;
const bool arrowHover = mouseOver && (toolButtonOption->activeSubControls & SC_ToolButtonMenu);
if( flat && menuStyle != BreezePrivate::ToolButtonMenuArrowStyle::None )
{
if( sunken && !mouseOver ) color = palette.color( QPalette::HighlightedText );
else {
if(sunken && !mouseOver ) {
color = palette.color(QPalette::HighlightedText);
} else if (checked && !mouseOver) {
color = _helper->arrowColor(palette, QPalette::WindowText);
} else if (checked && arrowHover) {
// If the button is checked we have a focus color tinted background on hover
color = palette.color(QPalette::HighlightedText);
} else {
// for menu arrows in flat toolbutton one uses animations to get the arrow color
// handle arrow over animation
const bool arrowHover( mouseOver && ( toolButtonOption->activeSubControls & SC_ToolButtonMenu ) );
_animations->toolButtonEngine().updateState( widget, AnimationHover, arrowHover );
const bool animated( _animations->toolButtonEngine().isAnimated( widget, AnimationHover ) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment