mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Make sure to hide the mainwindow on startup if it was hidden last time. Also fix the logic to ensure either the tray icon or the window is visible.
This commit is contained in:
parent
b8be261700
commit
a5412cc274
@ -342,20 +342,17 @@ MainWindow::MainWindow(QNetworkAccessManager* network, QWidget *parent)
|
|||||||
library_->SetGroupBy(g);
|
library_->SetGroupBy(g);
|
||||||
UpdateGroupBySelection(g);
|
UpdateGroupBySelection(g);
|
||||||
|
|
||||||
if (!settings_.value("hidden", false).toBool()) {
|
bool hidden = settings_.value("hidden", false).toBool();
|
||||||
show();
|
bool show_tray = settings_.value("showtray", true).toBool();
|
||||||
}
|
setVisible(!hidden);
|
||||||
|
|
||||||
if (settings_.value("showtray", true).toBool()) {
|
if (show_tray)
|
||||||
tray_icon_->show();
|
tray_icon_->show();
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
ui_.action_hide_tray_icon->setText(tr("&Show tray icon"));
|
ui_.action_hide_tray_icon->setText(tr("&Show tray icon"));
|
||||||
}
|
|
||||||
|
|
||||||
// Force the window to show in case somehow the config has tray and window set to hide
|
// Force the window to show in case somehow the config has tray and window set to hide
|
||||||
// Why doesn't .toBool() work? This might be the case for any combinations with .toBool(); use .toInt()
|
if (hidden && !show_tray) {
|
||||||
if (!settings_.value("hidden", true).toInt() && !settings_.value("showtray", false).toInt()) {
|
|
||||||
settings_.setValue("hidden", false);
|
settings_.setValue("hidden", false);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user