Skip to content

Commit

Permalink
Revert "Revert "Do not draw background or line in toolbars if the col…
Browse files Browse the repository at this point in the history
…or scheme has no headers group""

This reverts commit 9f40b17.

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
Pointedstick committed Feb 17, 2021
1 parent 6f0a286 commit 8fb164f
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kstyle/breezestyle.cpp
Original file line number Diff line number Diff line change
@@ -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);
7 changes: 7 additions & 0 deletions kstyle/breezetoolsareamanager.cpp
Original file line number Diff line number Diff line change
@@ -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;
}
}
3 changes: 3 additions & 0 deletions kstyle/breezetoolsareamanager.h
Original file line number Diff line number Diff line change
@@ -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();
};
}

0 comments on commit 8fb164f

Please sign in to comment.