diff --git a/src/config.cc b/src/config.cc index 49dd4ff3..117ebc2e 100644 --- a/src/config.cc +++ b/src/config.cc @@ -197,8 +197,6 @@ Preferences::Preferences(): hideSingleTab( false ), mruTabOrder( false ), hideMenubar( false ), - enableTrayIcon( true ), - startToTray( false ), autoStart( false ), doubleClickTranslates( true ), selectWordBySingleClick( false ), @@ -902,11 +900,10 @@ Class load() c.preferences.hideSingleTab = ( preferences.namedItem( "hideSingleTab" ).toElement().text() == "1" ); c.preferences.mruTabOrder = ( preferences.namedItem( "mruTabOrder" ).toElement().text() == "1" ); c.preferences.hideMenubar = ( preferences.namedItem( "hideMenubar" ).toElement().text() == "1" ); - +#ifndef Q_OS_MACOS // // macOS uses the dock menu instead of the tray icon c.preferences.enableTrayIcon = ( preferences.namedItem( "enableTrayIcon" ).toElement().text() == "1" ); c.preferences.startToTray = ( preferences.namedItem( "startToTray" ).toElement().text() == "1" ); -#ifndef Q_OS_MACOS // // macOS uses the dock menu instead of the tray icon - c.preferences.closeToTray = ( preferences.namedItem( "closeToTray" ).toElement().text() == "1" ); + c.preferences.closeToTray = ( preferences.namedItem( "closeToTray" ).toElement().text() == "1" ); #endif c.preferences.autoStart = ( preferences.namedItem( "autoStart" ).toElement().text() == "1" ); c.preferences.alwaysOnTop = ( preferences.namedItem( "alwaysOnTop" ).toElement().text() == "1" ); diff --git a/src/config.hh b/src/config.hh index 497b1592..20589e05 100644 --- a/src/config.hh +++ b/src/config.hh @@ -341,12 +341,15 @@ struct Preferences bool hideSingleTab; bool mruTabOrder; bool hideMenubar; - bool enableTrayIcon; - bool startToTray; + #ifdef Q_OS_MACOS // macOS uses the dock menu instead of the tray icon - bool closeToTray = false; + bool closeToTray = false; + bool enableTrayIcon = false; + bool startToTray = false; #else - bool closeToTray = true; + bool enableTrayIcon = true; + bool closeToTray = true; + bool startToTray = false; #endif bool autoStart; diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index c6ee0084..b7a2ab04 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -1426,6 +1426,7 @@ void MainWindow::trayIconUpdateOrInit() { #ifdef Q_OS_MACOS trayIconMenu.setAsDockMenu(); + ui.actionCloseToTray->setVisible( false ); #else if ( !cfg.preferences.enableTrayIcon ) {