diff --git a/kstyle/breeze.kcfg b/kstyle/breeze.kcfg index bd8fa8fc..76cf5f49 100644 --- a/kstyle/breeze.kcfg +++ b/kstyle/breeze.kcfg @@ -45,6 +45,11 @@ MN_NEVER + + + true + + true diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp index bde131d3..db2a4749 100644 --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -190,7 +190,7 @@ namespace Breeze } //______________________________________________________________________________ - QColor Helper::checkBoxMarkerColor( const QPalette& palette, bool mouseOver, bool active, qreal opacity, AnimationMode mode ) const + QColor Helper::checkBoxIndicatorColor( const QPalette& palette, bool mouseOver, bool active, qreal opacity, AnimationMode mode ) const { QColor color( KColorUtils::mix( palette.color( QPalette::Window ), palette.color( QPalette::WindowText ), 0.5 ) ); @@ -216,6 +216,10 @@ namespace Breeze } + //______________________________________________________________________________ + QColor Helper::separatorColor( const QPalette& palette ) const + { return KColorUtils::mix( palette.color( QPalette::Window ), palette.color( QPalette::WindowText ), 0.25 ); } + //______________________________________________________________________________ QPalette Helper::disabledPalette( const QPalette& source, qreal ratio ) const { diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h index 2004b56d..2aeeee6b 100644 --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -99,8 +99,11 @@ namespace Breeze //! slider outline color, using animations QColor sliderOutlineColor( const QPalette&, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode ) const; - //! checkbox marker, using animations - QColor checkBoxMarkerColor( const QPalette&, bool mouseOver, bool active, qreal opacity, AnimationMode ) const; + //! checkbox indicator, using animations + QColor checkBoxIndicatorColor( const QPalette&, bool mouseOver, bool active, qreal opacity, AnimationMode ) const; + + //! separator color + QColor separatorColor( const QPalette& ) const; //! merge active and inactive palettes based on ratio, for smooth enable state change transition QPalette disabledPalette( const QPalette&, qreal ratio ) const; diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index c7c0302b..cca0f86b 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -598,6 +598,7 @@ namespace Breeze case PE_IndicatorArrowLeft: fcn = &Style::drawIndicatorArrowLeftPrimitive; break; case PE_IndicatorArrowRight: fcn = &Style::drawIndicatorArrowRightPrimitive; break; case PE_IndicatorHeaderArrow: fcn = &Style::drawIndicatorHeaderArrowPrimitive; break; + case PE_IndicatorToolBarSeparator: fcn = &Style::drawIndicatorToolBarSeparatorPrimitive; break; // frames case PE_FrameStatusBar: fcn = &Style::emptyPrimitive; break; @@ -2171,7 +2172,7 @@ namespace Breeze // colors const QPalette& palette( option->palette ); - const QColor color( _helper->checkBoxMarkerColor( palette, mouseOver, enabled && active, opacity, mode ) ); + const QColor color( _helper->checkBoxIndicatorColor( palette, mouseOver, enabled && active, opacity, mode ) ); const QColor shadow( _helper->shadowColor( palette ) ); // render @@ -2199,7 +2200,7 @@ namespace Breeze // colors const QPalette& palette( option->palette ); - const QColor color( _helper->checkBoxMarkerColor( palette, mouseOver, enabled && checked, opacity, mode ) ); + const QColor color( _helper->checkBoxIndicatorColor( palette, mouseOver, enabled && checked, opacity, mode ) ); const QColor shadow( _helper->shadowColor( palette ) ); // render @@ -2209,6 +2210,38 @@ namespace Breeze } + //___________________________________________________________________________________ + bool Style::drawIndicatorToolBarSeparatorPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* ) const + { + + // do nothing if disabled from options + if( !StyleConfigData::toolBarDrawItemSeparator() ) return true; + + const State& flags( option->state ); + const bool horizontal( flags & State_Horizontal ); + const QRect& rect( option->rect ); + const QPalette& palette( option->palette ); + + painter->setRenderHint( QPainter::Antialiasing, false ); + painter->setBrush( Qt::NoBrush ); + painter->setPen( _helper->separatorColor( palette ) ); + if( horizontal ) + { + + painter->translate( rect.width()/2, 0 ); + painter->drawLine( rect.topLeft(), rect.bottomLeft() ); + + } else { + + painter->translate( 0, rect.height()/2 ); + painter->drawLine( rect.topLeft(), rect.topRight() ); + + } + + return true; + + } + //___________________________________________________________________________________ bool Style::drawPushButtonLabelControl( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const { @@ -2755,22 +2788,26 @@ namespace Breeze case QFrame::HLine: { + painter->setRenderHint( QPainter::Antialiasing, false ); const QPalette& palette( option->palette ); const QRect rect( option->rect ); - const QColor color( KColorUtils::mix( palette.color( QPalette::Window ), palette.color( QPalette::WindowText ), 0.25 ) ); painter->setBrush( Qt::NoBrush ); - painter->setPen( QPen( color, 1 ) ); + painter->setPen( _helper->separatorColor( palette ) ); + + painter->translate( 0, rect.height()/2 ); painter->drawLine( rect.topLeft(), rect.topRight() ); return true; } case QFrame::VLine: { + painter->setRenderHint( QPainter::Antialiasing, false ); const QPalette& palette( option->palette ); const QRect rect( option->rect ); - const QColor color( KColorUtils::mix( palette.color( QPalette::Window ), palette.color( QPalette::WindowText ), 0.25 ) ); painter->setBrush( Qt::NoBrush ); - painter->setPen( QPen( color, 1 ) ); + painter->setPen( _helper->separatorColor( palette ) ); + + painter->translate( rect.width()/2, 0 ); painter->drawLine( rect.topLeft(), rect.bottomLeft() ); return true; } diff --git a/kstyle/breezestyle.h b/kstyle/breezestyle.h index 1d1875e7..38eff5eb 100644 --- a/kstyle/breezestyle.h +++ b/kstyle/breezestyle.h @@ -328,7 +328,7 @@ namespace Breeze bool drawIndicatorRadioButtonPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; // bool drawIndicatorTabTearPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; // bool drawIndicatorToolBarHandlePrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; -// bool drawIndicatorToolBarSeparatorPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; + bool drawIndicatorToolBarSeparatorPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; // bool drawWidgetPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const; //@}