decorations: small refactor for decorationpalette.cpp
Handle header color schemes first since the code is smaller for that block, which makes things more readable.
This commit is contained in:
parent
00ade26624
commit
6c2834cc8a
1 changed files with 5 additions and 5 deletions
|
@ -128,7 +128,11 @@ void DecorationPalette::update()
|
|||
{
|
||||
m_colorSchemeConfig->sync();
|
||||
|
||||
if (!KColorScheme::isColorSetSupported(m_colorSchemeConfig, KColorScheme::Header)) {
|
||||
if (KColorScheme::isColorSetSupported(m_colorSchemeConfig, KColorScheme::Header)) {
|
||||
m_palette.active = KColorScheme(QPalette::Normal, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_palette.inactive = KColorScheme(QPalette::Inactive, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_legacyPalette.reset();
|
||||
} else {
|
||||
KConfigGroup wmConfig(m_colorSchemeConfig, QStringLiteral("WM"));
|
||||
|
||||
if (!wmConfig.exists()) {
|
||||
|
@ -149,10 +153,6 @@ void DecorationPalette::update()
|
|||
|
||||
KConfigGroup windowColorsConfig(m_colorSchemeConfig, QStringLiteral("Colors:Window"));
|
||||
m_legacyPalette->warningForegroundColor = windowColorsConfig.readEntry("ForegroundNegative", QColor(237, 21, 2));
|
||||
} else {
|
||||
m_palette.active = KColorScheme(QPalette::Normal, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_palette.inactive = KColorScheme(QPalette::Inactive, KColorScheme::Header, m_colorSchemeConfig);
|
||||
m_legacyPalette.reset();
|
||||
}
|
||||
|
||||
Q_EMIT changed();
|
||||
|
|
Loading…
Reference in a new issue