diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index a2e0dc2c..51baf9fc 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -388,9 +388,19 @@ namespace Breeze setTranslucentBackground( widget ); - } else if ( qobject_cast (widget) || qobject_cast (widget) ) { + } else if ( qobject_cast (widget) ) { widget->setAttribute(Qt::WA_StyledBackground); } + else if ( qobject_cast (widget) ) { + widget->setAttribute(Qt::WA_StyledBackground); + + if (_toolsAreaManager->hasHeaderColors() && _helper->shouldDrawToolsArea(widget)) { + const QMargins margins = widget->contentsMargins(); + widget->setContentsMargins(margins.left(), qMax(margins.top(), 1), margins.right(), margins.bottom()); + } + } + + // base class polishing ParentStyleClass::polish( widget ); @@ -941,8 +951,6 @@ namespace Breeze painter->restore(); } else if (auto dialog = qobject_cast(widget)) { - auto margins = dialog->contentsMargins(); - const_cast(dialog)->setContentsMargins(margins.left(), qMax(margins.top(), 1), margins.right(), margins.bottom()); painter->setPen(QPen(_helper->separatorColor(_toolsAreaManager->palette()), PenWidth::Frame * widget->devicePixelRatio())); painter->drawLine(widget->rect().topLeft(), widget->rect().topRight()); }