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

This reverts commit 9f40b17e57.

The idea of a Tools Area separator only makes sense when there is a unibody
Tools Area. When using a color scheme without Header colors, there is no
Tools Area (just a disparate collection of titlebars, manubars, and
toolbars), so the line is just extra visual noise that various people
have objected to following the Plasma 5.21 release. Let's make it
conditional on using a color scheme with Header colors again.

BUG: 433118
FIXED-IN: 5.21.1
wilder-5.24
Nate Graham 5 years ago
parent 5de36bd138
commit 2f1fc86a13
  1. 2
      kstyle/breezestyle.cpp
  2. 7
      kstyle/breezetoolsareamanager.cpp
  3. 3
      kstyle/breezetoolsareamanager.h

@ -950,7 +950,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);

@ -121,6 +121,8 @@ namespace Breeze {
}
}
}
_colorSchemeHasHeaderColor = KColorScheme::isColorSetSupported(_config, KColorScheme::Header);
}
bool AppListener::eventFilter(QObject *watched, QEvent *event)
@ -239,4 +241,9 @@ namespace Breeze {
_windows[mainWindow].removeAll(toolbar);
}
}
bool Breeze::ToolsAreaManager::hasHeaderColors()
{
return _colorSchemeHasHeaderColor;
}
}

@ -37,6 +37,7 @@ namespace Breeze {
KConfigWatcher::Ptr _watcher;
QPalette _palette = QPalette();
AppListener* _listener;
bool _colorSchemeHasHeaderColor;
friend class AppListener;
@ -58,6 +59,8 @@ namespace Breeze {
void unregisterWidget(QWidget *widget);
QRect toolsAreaRect(const QMainWindow *window);
bool hasHeaderColors();
};
}

Loading…
Cancel
Save