summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r--gui/main-window.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp
index 89235720..0f070cc4 100644
--- a/gui/main-window.cpp
+++ b/gui/main-window.cpp
@@ -687,13 +687,16 @@ void MainWindow::ensure_tray()
}
else
{
- if (isHidden())
+ const bool is_hidden = isHidden() || !isVisible();
+
+ if (is_hidden)
+ {
show();
- if (!isVisible())
setVisible(true);
- raise(); // for OSX
- activateWindow(); // for Windows
+ raise(); // for OSX
+ activateWindow(); // for Windows
+ }
if (tray)
tray->hide();
@@ -824,6 +827,11 @@ bool MainWindow::is_tray_enabled()
return s.tray_enabled && QSystemTrayIcon::isSystemTrayAvailable();
}
+bool MainWindow::start_in_tray()
+{
+ return s.tray_enabled && s.tray_start && QSystemTrayIcon::isSystemTrayAvailable();
+}
+
void MainWindow::set_profile_in_registry(const QString &profile)
{
QSettings settings(OPENTRACK_ORG);