Commit ce4e031f authored by David Redondo's avatar David Redondo 🏎

Do not draw background or line in toolbars if the color scheme has no headers group

Effectively do the same as in the past when we do not have a headers group.
Trigger for this is that the line does not work in such cases but we also
do not need to draw the background in any special way then.
parent eef7a6a2
......@@ -912,7 +912,7 @@ namespace Breeze
bool Style::drawWidgetPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* widget ) const {
Q_UNUSED(option)
auto parent = widget;
if (!_helper->shouldDrawToolsArea(widget)) {
if (!_toolsAreaManager->hasHeaderColors() || !_helper->shouldDrawToolsArea(widget)) {
return true;
}
auto mw = qobject_cast<const QMainWindow*>(widget);
......
......@@ -126,6 +126,8 @@ namespace Breeze {
}
}
}
_colorSchemeHasHeaderColor = KColorScheme::isColorSetSupported(_config, KColorScheme::Header);
}
bool AppListener::eventFilter(QObject *watched, QEvent *event)
......@@ -244,4 +246,9 @@ namespace Breeze {
_windows[mainWindow].removeAll(toolbar);
}
}
bool Breeze::ToolsAreaManager::hasHeaderColors()
{
return _colorSchemeHasHeaderColor;
}
}
......@@ -36,6 +36,7 @@ namespace Breeze {
KConfigWatcher::Ptr _watcher;
QPalette _palette = QPalette();
AppListener* _listener;
bool _colorSchemeHasHeaderColor;
friend class AppListener;
......@@ -57,6 +58,8 @@ namespace Breeze {
void unregisterWidget(QWidget *widget);
QRect toolsAreaRect(const QMainWindow *window);
bool hasHeaderColors();
};
}
......
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