diff --git a/kstyle/breeze.kcfg b/kstyle/breeze.kcfg --- a/kstyle/breeze.kcfg +++ b/kstyle/breeze.kcfg @@ -34,7 +34,12 @@ - + + + + true + + true diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -277,14 +277,14 @@ const QColor sunkenColor = alphaColor( palette.color( QPalette::WindowText ), 0.2 ); // hover takes precedence over focus - if( mode == AnimationHover ) + if( mode == AnimationHover && StyleConfigData::hoverEnabled() ) { if( hasFocus ) outline = KColorUtils::mix( focusColor, hoverColor, opacity ); else if( sunken ) outline = sunkenColor; else outline = alphaColor( hoverColor, opacity ); - } else if( mouseOver ) { + } else if( mouseOver && StyleConfigData::hoverEnabled() ) { outline = hoverColor; @@ -380,15 +380,15 @@ { QColor color( KColorUtils::mix( palette.color( QPalette::Window ), palette.color( QPalette::WindowText ), 0.6 ) ); - if( mode == AnimationHover ) + if( mode == AnimationHover && StyleConfigData::hoverEnabled() ) { const QColor focus( focusColor( palette ) ); const QColor hover( hoverColor( palette ) ); if( active ) color = KColorUtils::mix( focus, hover, opacity ); else color = KColorUtils::mix( color, hover, opacity ); - } else if( mouseOver ) { + } else if( mouseOver && StyleConfigData::hoverEnabled() ) { color = hoverColor( palette ); diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -232,7 +232,7 @@ || qobject_cast( widget ) || widget->inherits( "KTextEditor::View" ) ) - { widget->setAttribute( Qt::WA_Hover ); } + { widget->setAttribute( Qt::WA_Hover, StyleConfigData::hoverEnabled() ); } // enforce translucency for drag and drop window if( widget->testAttribute( Qt::WA_X11NetWmWindowTypeDND ) && _helper->compositingActive() ) @@ -248,21 +248,21 @@ { // enable mouse over effects in itemviews' viewport - itemView->viewport()->setAttribute( Qt::WA_Hover ); + itemView->viewport()->setAttribute( Qt::WA_Hover, StyleConfigData::hoverEnabled() ); } else if( QGroupBox* groupBox = qobject_cast( widget ) ) { // checkable group boxes if( groupBox->isCheckable() ) - { groupBox->setAttribute( Qt::WA_Hover ); } + { groupBox->setAttribute( Qt::WA_Hover, StyleConfigData::hoverEnabled() ); } } else if( qobject_cast( widget ) && qobject_cast( widget->parent() ) ) { - widget->setAttribute( Qt::WA_Hover ); + widget->setAttribute( Qt::WA_Hover, StyleConfigData::hoverEnabled() ); } else if( qobject_cast( widget ) && qobject_cast( widget->parent() ) ) { - widget->setAttribute( Qt::WA_Hover ); + widget->setAttribute( Qt::WA_Hover, StyleConfigData::hoverEnabled() ); } else if( qobject_cast( widget ) && widget->parent() && widget->parent()->inherits( "KTitleWidget" ) ) { @@ -3675,7 +3675,7 @@ } // stop here if no highlight is needed - if( !( mouseOver || selected ||hasCustomBackground ) ) + if( !( ( mouseOver && StyleConfigData::hoverEnabled() ) || selected ||hasCustomBackground ) ) { return true; } // render custom background @@ -3697,7 +3697,7 @@ else color = palette.color( colorGroup, QPalette::Highlight ); // change color to implement mouse over - if( mouseOver && !hasCustomBackground ) + if( mouseOver && StyleConfigData::hoverEnabled() && !hasCustomBackground ) { if( !selected ) color.setAlphaF( 0.2 ); else color = color.lighter( 110 ); @@ -4068,7 +4068,7 @@ else orientation = ArrowRight; // color - const QColor arrowColor( mouseOver ? _helper->hoverColor( palette ) : _helper->arrowColor( palette, QPalette::Text ) ); + const QColor arrowColor( mouseOver && StyleConfigData::hoverEnabled() ? _helper->hoverColor( palette ) : _helper->arrowColor( palette, QPalette::Text ) ); // render _helper->renderArrow( painter, arrowRect, arrowColor, orientation ); @@ -4520,11 +4520,14 @@ const State& state( option->state ); const bool enabled( state & State_Enabled ); const bool selected( enabled && (state & State_Selected) ); + const bool open( enabled && (state & State_Open) ); + const bool on( enabled && (state & State_On) ); const bool sunken( enabled && (state & State_Sunken) ); + const bool mouseOver( enabled && (state & State_MouseOver) ); const bool useStrongFocus( StyleConfigData::menuItemDrawStrongFocus() ); // render hover and focus - if( useStrongFocus && ( selected || sunken ) ) + if( useStrongFocus && ( ( selected && StyleConfigData::hoverEnabled() ) || sunken ) ) { QColor outlineColor; @@ -6372,7 +6375,7 @@ if( opacity == AnimationData::OpacityInvalid ) opacity = 1; // render full groove directly, rather than using the addPage and subPage control element methods - if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) + if( (!StyleConfigData::hoverEnabled() || !StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) { // retrieve groove rectangle QRect grooveRect( subControlRect( CC_ScrollBar, option, SC_ScrollBarGroove, widget ) ); diff --git a/kstyle/config/breezestyleconfig.cpp b/kstyle/config/breezestyleconfig.cpp --- a/kstyle/config/breezestyleconfig.cpp +++ b/kstyle/config/breezestyleconfig.cpp @@ -58,6 +58,7 @@ connect( _menuItemDrawThinFocus, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _sliderDrawTickMarks, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _splitterProxyEnabled, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); + connect( _hoverEnabled, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _mnemonicsMode, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); connect( _animationsEnabled, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _animationsDuration, SIGNAL(valueChanged(int)), SLOT(updateChanged()) ); @@ -79,6 +80,7 @@ StyleConfigData::setMenuItemDrawStrongFocus( !_menuItemDrawThinFocus->isChecked() ); StyleConfigData::setSliderDrawTickMarks( _sliderDrawTickMarks->isChecked() ); StyleConfigData::setSplitterProxyEnabled( _splitterProxyEnabled->isChecked() ); + StyleConfigData::setHoverEnabled( _hoverEnabled->isChecked() ); StyleConfigData::setMnemonicsMode( _mnemonicsMode->currentIndex() ); StyleConfigData::setScrollBarAddLineButtons( _scrollBarAddLineButtons->currentIndex() ); StyleConfigData::setScrollBarSubLineButtons( _scrollBarSubLineButtons->currentIndex() ); @@ -144,6 +146,7 @@ else if( _scrollBarAddLineButtons->currentIndex() != StyleConfigData::scrollBarAddLineButtons() ) modified = true; else if( _scrollBarSubLineButtons->currentIndex() != StyleConfigData::scrollBarSubLineButtons() ) modified = true; else if( _splitterProxyEnabled->isChecked() != StyleConfigData::splitterProxyEnabled() ) modified = true; + else if( _hoverEnabled->isChecked() != StyleConfigData::hoverEnabled() ) modified = true; else if( _animationsEnabled->isChecked() != StyleConfigData::animationsEnabled() ) modified = true; else if( _animationsDuration->value() != StyleConfigData::animationsDuration() ) modified = true; else if( _windowDragMode->currentIndex() != StyleConfigData::windowDragMode() ) modified = true; @@ -166,6 +169,7 @@ _sliderDrawTickMarks->setChecked( StyleConfigData::sliderDrawTickMarks() ); _mnemonicsMode->setCurrentIndex( StyleConfigData::mnemonicsMode() ); _splitterProxyEnabled->setChecked( StyleConfigData::splitterProxyEnabled() ); + _hoverEnabled->setChecked( StyleConfigData::hoverEnabled() ); _scrollBarAddLineButtons->setCurrentIndex( StyleConfigData::scrollBarAddLineButtons() ); _scrollBarSubLineButtons->setCurrentIndex( StyleConfigData::scrollBarSubLineButtons() ); _animationsEnabled->setChecked( StyleConfigData::animationsEnabled() ); diff --git a/kstyle/config/ui/breezestyleconfig.ui b/kstyle/config/ui/breezestyleconfig.ui --- a/kstyle/config/ui/breezestyleconfig.ui +++ b/kstyle/config/ui/breezestyleconfig.ui @@ -6,8 +6,8 @@ 0 0 - 522 - 257 + 532 + 292 @@ -33,33 +33,49 @@ General - - - - - 0 - 0 - - + + - W&indows' drag mode: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Center tabbar tabs - - _windowDragMode + + + + + + Draw toolbar item separators - + Draw focus indicator in lists - + + + + Draw slider tick marks + + + + + + + Enable extended resize handles + + + + + + + Enable hover effects + + + + &Keyboard accelerators visibility: @@ -72,7 +88,7 @@ - + @@ -91,7 +107,7 @@ - + Qt::Horizontal @@ -104,7 +120,26 @@ - + + + + + 0 + 0 + + + + W&indows' drag mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + _windowDragMode + + + + @@ -123,7 +158,7 @@ - + Qt::Vertical @@ -136,34 +171,6 @@ - - - - Center tabbar tabs - - - - - - - Draw toolbar item separators - - - - - - - Draw slider tick marks - - - - - - - Enable extended resize handles - - - @@ -388,8 +395,10 @@ tabWidget _tabBarDrawCenteredTabs _toolBarDrawItemSeparator + _viewDrawFocusIndicator _sliderDrawTickMarks _splitterProxyEnabled + _hoverEnabled _mnemonicsMode _windowDragMode _animationsEnabled