Commit 38335a2e authored by David Redondo's avatar David Redondo 🏎
Browse files

[kcm/color]: Align fake titlebar with what decoration is doing

The logic in Kwin is reversed from what was here, first check if we have header
colors, otherwise fall back. Also remove the gradient since it is now disabled
by default in Breeze.
parent ad1e59e0
......@@ -185,10 +185,16 @@ void ColorsModel::load()
const QPalette palette = KColorScheme::createApplicationPalette(config);
KColorScheme headerColorScheme(QPalette::Active, KColorScheme::Header, config);
KConfigGroup wmConfig(config, QStringLiteral("WM"));
const QColor activeTitleBarBackground = wmConfig.readEntry("activeBackground", headerColorScheme.background().color());
const QColor activeTitleBarForeground = wmConfig.readEntry("activeForeground", headerColorScheme.foreground().color());
QColor activeTitleBarBackground, activeTitleBarForeground;
if (KColorScheme::isColorSetSupported(config, KColorScheme::Header)) {
KColorScheme headerColorScheme(QPalette::Active, KColorScheme::Header, config);
activeTitleBarBackground = headerColorScheme.background().color();
activeTitleBarForeground = headerColorScheme.foreground().color();
} else {
KConfigGroup wmConfig(config, QStringLiteral("WM"));
activeTitleBarBackground = wmConfig.readEntry("activeBackground", palette.color(QPalette::Active, QPalette::Highlight));
activeTitleBarForeground = wmConfig.readEntry("activeForeground", palette.color(QPalette::Active, QPalette::HighlightedText));
ColorsModelData item{
......@@ -154,11 +154,6 @@ KCM.GridViewKCM {
id: windowTitleBar
width: parent.width
height: Math.round(Kirigami.Units.gridUnit * 1.5)
gradient: Gradient {
// from Breeze Decoration::paintTitleBar
GradientStop { position: 0.0; color: Qt.lighter(model.activeTitleBarBackground, 1.2) }
GradientStop { position: 0.8; color: model.activeTitleBarBackground }
color: model.activeTitleBarBackground
Supports Markdown
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