mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
Start from effective config.
Took 8 minutes
This commit is contained in:
parent
79bb8a9572
commit
59afc7047a
1 changed files with 7 additions and 7 deletions
|
|
@ -210,14 +210,14 @@ ThemeConfig ThemeManager::effectiveThemeConfig(const QString &themeName)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeManager::setStyleName(const QString &styleName)
|
void ThemeManager::setStyleName(const QString &style)
|
||||||
{
|
{
|
||||||
const QString themeName = SettingsCache::instance().getThemeName();
|
const QString themeName = SettingsCache::instance().getThemeName();
|
||||||
const QString dirPath = getAvailableThemes().value(themeName);
|
|
||||||
const QString userDirPath = userThemeDirFor(themeName);
|
const QString userDirPath = userThemeDirFor(themeName);
|
||||||
|
|
||||||
ThemeConfig cfg = ThemeConfig::fromThemeDir(dirPath);
|
ThemeConfig cfg = effectiveThemeConfig(themeName);
|
||||||
cfg.styleName = styleName;
|
|
||||||
|
cfg.styleName = style;
|
||||||
cfg.save(userDirPath);
|
cfg.save(userDirPath);
|
||||||
|
|
||||||
reloadCurrentTheme();
|
reloadCurrentTheme();
|
||||||
|
|
@ -292,13 +292,13 @@ bool ThemeManager::savePaletteConfig(const QString &themeDirPath, const QString
|
||||||
void ThemeManager::setColorScheme(const QString &scheme)
|
void ThemeManager::setColorScheme(const QString &scheme)
|
||||||
{
|
{
|
||||||
const QString themeName = SettingsCache::instance().getThemeName();
|
const QString themeName = SettingsCache::instance().getThemeName();
|
||||||
const QString dirPath = getAvailableThemes().value(themeName);
|
|
||||||
const QString userDirPath = userThemeDirFor(themeName);
|
const QString userDirPath = userThemeDirFor(themeName);
|
||||||
|
|
||||||
// Read base config from system; write the scheme override to user dir
|
ThemeConfig cfg = effectiveThemeConfig(themeName);
|
||||||
ThemeConfig cfg = ThemeConfig::fromThemeDir(dirPath);
|
|
||||||
cfg.colorScheme = scheme;
|
cfg.colorScheme = scheme;
|
||||||
cfg.save(userDirPath);
|
cfg.save(userDirPath);
|
||||||
|
|
||||||
reloadCurrentTheme();
|
reloadCurrentTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue