diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 20341d8a..dd78ce67 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -160,6 +160,18 @@ namespace Breeze delete _helper; } + //______________________________________________________________ + void Style::polish( QApplication* ) + { + + // alter palette for relevant framed widgets + const QPalette palette( _helper->framePalette( QGuiApplication::palette() ) ); + QApplication::setPalette( palette, "QDockWidget" ); + QApplication::setPalette( palette, "QGroupBox" ); + QApplication::setPalette( palette, "QTabWidget" ); + + } + //______________________________________________________________ void Style::polish( QWidget* widget ) { @@ -206,19 +218,10 @@ namespace Breeze } else if( QGroupBox* groupBox = qobject_cast( widget ) ) { - // change palette - widget->setPalette( _helper->framePalette( QGuiApplication::palette() ) ); - // checkable group boxes if( groupBox->isCheckable() ) { groupBox->setAttribute( Qt::WA_Hover ); } - - } else if( qobject_cast( widget ) ) { - - // change palette - widget->setPalette( _helper->framePalette( QGuiApplication::palette() ) ); - } else if( qobject_cast( widget ) && qobject_cast( widget->parent() ) ) { widget->setAttribute( Qt::WA_Hover ); @@ -263,7 +266,6 @@ namespace Breeze // add event filter on dock widgets // and alter palette widget->setAutoFillBackground( false ); - widget->setPalette( _helper->framePalette( QGuiApplication::palette() ) ); widget->setContentsMargins( Metrics::Frame_FrameWidth, Metrics::Frame_FrameWidth, Metrics::Frame_FrameWidth, Metrics::Frame_FrameWidth ); addEventFilter( widget ); diff --git a/kstyle/breezestyle.h b/kstyle/breezestyle.h index ed177dc2..c127fa47 100644 --- a/kstyle/breezestyle.h +++ b/kstyle/breezestyle.h @@ -88,6 +88,9 @@ namespace Breeze //! destructor virtual ~Style( void ); + //! application polishing + virtual void polish( QApplication* ); + //! widget polishing virtual void polish( QWidget* );