forked from blue/squawk
First tray attempt, seems to be working
This commit is contained in:
parent
7192286aeb
commit
7e9eed2075
13 changed files with 201 additions and 7 deletions
|
@ -57,6 +57,7 @@ void Settings::onVariableModified(const QString& key, const QVariant& value)
|
|||
void Settings::apply()
|
||||
{
|
||||
QSettings settings;
|
||||
bool trayChanged = false;
|
||||
for (const std::pair<const QString, QVariant>& pair: modifiedSettings) {
|
||||
if (pair.first == "style") {
|
||||
Shared::Global::setStyle(pair.second.toString());
|
||||
|
@ -73,8 +74,18 @@ void Settings::apply()
|
|||
emit changeDownloadsPath(path);
|
||||
}
|
||||
}
|
||||
} else if (pair.first == "tray" || pair.first == "hideTray") {
|
||||
bool oldValue = settings.value(pair.first, false).toBool();
|
||||
bool newValue = pair.second.toBool();
|
||||
if (oldValue != newValue) {
|
||||
trayChanged = true;
|
||||
settings.setValue(pair.first, pair.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trayChanged) {
|
||||
emit changeTray(settings.value("tray", false).toBool(), settings.value("hideTray", false).toBool());
|
||||
}
|
||||
|
||||
modifiedSettings.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue