1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

layout:update default color scheme ref properly

This commit is contained in:
Michail Vourlakos 2021-06-16 11:27:48 +03:00
parent a36a228938
commit f10ae3e239
5 changed files with 8 additions and 1 deletions

View File

@ -382,7 +382,8 @@ void AbstractLayout::loadConfig()
m_color = m_layoutGroup.readEntry("color", QString("blue"));
m_backgroundStyle = static_cast<BackgroundStyle>(m_layoutGroup.readEntry("backgroundStyle", (int)ColorBackgroundStyle));
m_schemeFile = m_layoutGroup.readEntry("schemeFile", Data::Layout::DEFAULTSCHEMEFILE);
m_schemeFile = m_layoutGroup.readEntry("schemeFile", QString(Data::Layout::DEFAULTSCHEMEFILE));
m_schemeFile = m_schemeFile.isEmpty() ? Data::Layout::DEFAULTSCHEMEFILE : m_schemeFile;
QString deprecatedTextColor = m_layoutGroup.readEntry("textColor", QString());
QString deprecatedBackground = m_layoutGroup.readEntry("background", QString());

View File

@ -55,6 +55,7 @@ void CentralLayout::initToCorona(Latte::Corona *corona)
m_corona->layoutsManager()->synchronizer(), &Layouts::Synchronizer::updateKWinDisabledBorders);
connect(this, &Layout::AbstractLayout::schemeFileChanged, this, &CentralLayout::onSchemeFileChanged);
connect(m_corona->wm()->schemesTracker(), &WindowSystem::Tracker::Schemes::defaultSchemeChanged, this, &CentralLayout::onSchemeFileChanged);
}
}

View File

@ -89,6 +89,8 @@ void Schemes::updateDefaultScheme()
if (!m_schemes.contains("kdeglobals") || m_schemes["kdeglobals"]->schemeFile() != defaultSchemePath) {
m_schemes["kdeglobals"] = dScheme;
}
emit defaultSchemeChanged();
}
SchemeColors *Schemes::schemeForFile(const QString &scheme)

View File

@ -38,6 +38,7 @@ public:
signals:
void colorSchemeChanged(const WindowId &wid);
void defaultSchemeChanged();
private slots:
void updateDefaultScheme();

View File

@ -96,6 +96,8 @@ Loader{
return themeExtended.lightTheme;
} else if (root.themeColors === LatteContainment.Types.ReverseThemeColors) {
return themeExtended.isLightTheme ? themeExtended.darkTheme : themeExtended.lightTheme;
} else if (root.themeColors === LatteContainment.Types.LayoutThemeColors && latteView && latteView.layout) {
return latteView.layout.scheme;
}
if (root.themeColors === LatteContainment.Types.SmartThemeColors) {