color theme setting is now working

This commit is contained in:
Blue 2022-01-27 20:44:32 +03:00
parent 0ff9f12157
commit da19eb86bb
Signed by: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 142 additions and 33 deletions

View file

@ -40,13 +40,10 @@ void Settings::apply()
{
QSettings settings;
for (const std::pair<const QString, QVariant>& pair: modifiedSettings) {
if (pair.first == "theme") {
QString theme = pair.second.toString();
if (theme.toLower() == "system") {
QApplication::setStyle(Shared::Global::getInstance()->defaultSystemStyle);
} else {
QApplication::setStyle(theme);
}
if (pair.first == "style") {
Shared::Global::setStyle(pair.second.toString());
} else if (pair.first == "theme") {
Shared::Global::setTheme(pair.second.toString());
}
settings.setValue(pair.first, pair.second);