1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

respect plasma theme color palette always

--identify better what is the plasma theme color
palette the creator has chosen and use ALWAYS
the same color palette that Plasma is also using.
In the past, Latte was trying to protect the
color palette because Latte REVERSED colors mode
did not work fine for all plasma themes. That
approach is abandoned, Latte will use the same
colors group with plasma themes and it is on
the creators responsibility to provide enough
contrast
This commit is contained in:
Michail Vourlakos 2020-01-12 10:52:45 +02:00
parent aa441064e1
commit 9075af90c0
2 changed files with 15 additions and 15 deletions

View File

@ -232,11 +232,11 @@ void Theme::updateDefaultSchemeValues()
KSharedConfigPtr defaultPtr = KSharedConfig::openConfig(m_defaultSchemePath);
if (originalPtr && defaultPtr) {
KConfigGroup originalViewGroup(originalPtr, "Colors:View");
KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
KConfigGroup defaultWMGroup(defaultPtr, "WM");
defaultWMGroup.writeEntry("activeBackground", originalViewGroup.readEntry("BackgroundNormal", QColor()));
defaultWMGroup.writeEntry("activeForeground", originalViewGroup.readEntry("ForegroundNormal", QColor()));
defaultWMGroup.writeEntry("activeBackground", normalWindowGroup.readEntry("BackgroundNormal", QColor()));
defaultWMGroup.writeEntry("activeForeground", normalWindowGroup.readEntry("ForegroundNormal", QColor()));
defaultWMGroup.sync();
}
@ -290,7 +290,7 @@ void Theme::updateReversedSchemeValues()
//! update WM group
KConfigGroup reversedWMGroup(reversedPtr, "WM");
KConfigGroup originalViewGroup(originalPtr, "Colors:View");
KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
if (reversedWMGroup.keyList().contains("activeBackground")
&& reversedWMGroup.keyList().contains("activeForeground")
@ -298,8 +298,8 @@ void Theme::updateReversedSchemeValues()
&& reversedWMGroup.keyList().contains("inactiveForeground")) {
//! reverse usual wm titlebar values
KConfigGroup originalGroup(originalPtr, "WM");
reversedWMGroup.writeEntry("activeBackground", originalViewGroup.readEntry("ForegroundNormal", QColor()));
reversedWMGroup.writeEntry("activeForeground", originalViewGroup.readEntry("BackgroundNormal", QColor()));
reversedWMGroup.writeEntry("activeBackground", normalWindowGroup.readEntry("ForegroundNormal", QColor()));
reversedWMGroup.writeEntry("activeForeground", normalWindowGroup.readEntry("BackgroundNormal", QColor()));
reversedWMGroup.writeEntry("inactiveBackground", originalGroup.readEntry("inactiveForeground", QColor()));
reversedWMGroup.writeEntry("inactiveForeground", originalGroup.readEntry("inactiveBackground", QColor()));
reversedWMGroup.sync();

View File

@ -216,8 +216,8 @@ void SchemeColors::updateScheme()
KSharedConfigPtr filePtr = KSharedConfig::openConfig(m_schemeFile);
KConfigGroup wmGroup = KConfigGroup(filePtr, "WM");
KConfigGroup selGroup = KConfigGroup(filePtr, "Colors:Selection");
KConfigGroup viewGroup = KConfigGroup(filePtr, "Colors:View");
//KConfigGroup windowGroup = KConfigGroup(filePtr, "Colors:Window");
//KConfigGroup viewGroup = KConfigGroup(filePtr, "Colors:View");
KConfigGroup windowGroup = KConfigGroup(filePtr, "Colors:Window");
KConfigGroup buttonGroup = KConfigGroup(filePtr, "Colors:Button");
if (!m_basedOnPlasmaTheme) {
@ -226,18 +226,18 @@ void SchemeColors::updateScheme()
m_inactiveBackgroundColor = wmGroup.readEntry("inactiveBackground", QColor());
m_inactiveTextColor = wmGroup.readEntry("inactiveForeground", QColor());
} else {
m_activeBackgroundColor = viewGroup.readEntry("BackgroundNormal", QColor());
m_activeTextColor = viewGroup.readEntry("ForegroundNormal", QColor());
m_inactiveBackgroundColor = viewGroup.readEntry("BackgroundAlternate", QColor());
m_inactiveTextColor = viewGroup.readEntry("ForegroundInactive", QColor());
m_activeBackgroundColor = windowGroup.readEntry("BackgroundNormal", QColor());
m_activeTextColor = windowGroup.readEntry("ForegroundNormal", QColor());
m_inactiveBackgroundColor = windowGroup.readEntry("BackgroundAlternate", QColor());
m_inactiveTextColor = windowGroup.readEntry("ForegroundInactive", QColor());
}
m_highlightColor = selGroup.readEntry("BackgroundNormal", QColor());
m_highlightedTextColor = selGroup.readEntry("ForegroundNormal", QColor());
m_positiveTextColor = viewGroup.readEntry("ForegroundPositive", QColor());
m_neutralTextColor = viewGroup.readEntry("ForegroundNeutral", QColor());;
m_negativeTextColor = viewGroup.readEntry("ForegroundNegative", QColor());
m_positiveTextColor = windowGroup.readEntry("ForegroundPositive", QColor());
m_neutralTextColor = windowGroup.readEntry("ForegroundNeutral", QColor());;
m_negativeTextColor = windowGroup.readEntry("ForegroundNegative", QColor());
m_buttonTextColor = buttonGroup.readEntry("ForegroundNormal", QColor());
m_buttonBackgroundColor = buttonGroup.readEntry("BackgroundNormal", QColor());