Commit 9f462323 authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Nate Graham
Browse files

kcms/colors: Properly apply tinting to the window titlebar

Tint the window titlebars only when either the option to tint all colors with
accent color or the option to apply accent color to window titlebars is enabled 
or both), and in the latter case, the active window titlebars should be painted
in the accent color.

BUG: 455395
BUG: 454047
FIXED-IN: 5.25.3

(cherry picked from commit 00a18a8c)
parent cec67839
Pipeline #200262 passed with stage
in 12 minutes and 52 seconds
......@@ -272,15 +272,24 @@ void applyScheme(const QString &colorSchemePath, KConfig *configOutput, KConfig:
if (hasAccent()) { // Titlebar accent colouring
if (hasAccent() && (tintAccent || applyAccentToTitlebar)) { // Titlebar accent colouring
const auto windowBackground = config->group("Colors:Window").readEntry<QColor>("BackgroundNormal", QColor());
const auto accentedWindowBackground = accentBackground(getAccent(), windowBackground);
const auto inactiveWindowBackground = tintColor(windowBackground, getAccent(), tintFactor);
groupWMOut.writeEntry("activeBackground", applyAccentToTitlebar ? accentedWindowBackground : inactiveWindowBackground);
groupWMOut.writeEntry("activeForeground", accentForeground(accentedWindowBackground, true));
groupWMOut.writeEntry("inactiveBackground", inactiveWindowBackground);
groupWMOut.writeEntry("inactiveForeground", accentForeground(inactiveWindowBackground, false));
if (tintAccent) {
const auto tintedWindowBackground = tintColor(windowBackground, getAccent(), tintFactor);
if (!applyAccentToTitlebar) {
groupWMOut.writeEntry("activeBackground", tintedWindowBackground);
groupWMOut.writeEntry("activeForeground", accentForeground(tintedWindowBackground, true));
groupWMOut.writeEntry("inactiveBackground", tintedWindowBackground);
groupWMOut.writeEntry("inactiveForeground", accentForeground(tintedWindowBackground, false));
if (applyAccentToTitlebar) {
const auto accentedWindowBackground = accentBackground(getAccent(), windowBackground);
groupWMOut.writeEntry("activeBackground", accentedWindowBackground);
groupWMOut.writeEntry("activeForeground", accentForeground(accentedWindowBackground, true));
const QStringList groupNameList{QStringLiteral("ColorEffects:Inactive"), QStringLiteral("ColorEffects:Disabled")};
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