mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
disable more staffs related to macOS trayicon -> dock icon
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
This commit is contained in:
parent
1e3b22ebd0
commit
608016208b
|
@ -197,8 +197,6 @@ Preferences::Preferences():
|
||||||
hideSingleTab( false ),
|
hideSingleTab( false ),
|
||||||
mruTabOrder( false ),
|
mruTabOrder( false ),
|
||||||
hideMenubar( false ),
|
hideMenubar( false ),
|
||||||
enableTrayIcon( true ),
|
|
||||||
startToTray( false ),
|
|
||||||
autoStart( false ),
|
autoStart( false ),
|
||||||
doubleClickTranslates( true ),
|
doubleClickTranslates( true ),
|
||||||
selectWordBySingleClick( false ),
|
selectWordBySingleClick( false ),
|
||||||
|
@ -902,11 +900,10 @@ Class load()
|
||||||
c.preferences.hideSingleTab = ( preferences.namedItem( "hideSingleTab" ).toElement().text() == "1" );
|
c.preferences.hideSingleTab = ( preferences.namedItem( "hideSingleTab" ).toElement().text() == "1" );
|
||||||
c.preferences.mruTabOrder = ( preferences.namedItem( "mruTabOrder" ).toElement().text() == "1" );
|
c.preferences.mruTabOrder = ( preferences.namedItem( "mruTabOrder" ).toElement().text() == "1" );
|
||||||
c.preferences.hideMenubar = ( preferences.namedItem( "hideMenubar" ).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.enableTrayIcon = ( preferences.namedItem( "enableTrayIcon" ).toElement().text() == "1" );
|
||||||
c.preferences.startToTray = ( preferences.namedItem( "startToTray" ).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
|
#endif
|
||||||
c.preferences.autoStart = ( preferences.namedItem( "autoStart" ).toElement().text() == "1" );
|
c.preferences.autoStart = ( preferences.namedItem( "autoStart" ).toElement().text() == "1" );
|
||||||
c.preferences.alwaysOnTop = ( preferences.namedItem( "alwaysOnTop" ).toElement().text() == "1" );
|
c.preferences.alwaysOnTop = ( preferences.namedItem( "alwaysOnTop" ).toElement().text() == "1" );
|
||||||
|
|
|
@ -341,12 +341,15 @@ struct Preferences
|
||||||
bool hideSingleTab;
|
bool hideSingleTab;
|
||||||
bool mruTabOrder;
|
bool mruTabOrder;
|
||||||
bool hideMenubar;
|
bool hideMenubar;
|
||||||
bool enableTrayIcon;
|
|
||||||
bool startToTray;
|
|
||||||
#ifdef Q_OS_MACOS // macOS uses the dock menu instead of the tray icon
|
#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
|
#else
|
||||||
bool closeToTray = true;
|
bool enableTrayIcon = true;
|
||||||
|
bool closeToTray = true;
|
||||||
|
bool startToTray = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool autoStart;
|
bool autoStart;
|
||||||
|
|
|
@ -1426,6 +1426,7 @@ void MainWindow::trayIconUpdateOrInit()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
trayIconMenu.setAsDockMenu();
|
trayIconMenu.setAsDockMenu();
|
||||||
|
ui.actionCloseToTray->setVisible( false );
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if ( !cfg.preferences.enableTrayIcon ) {
|
if ( !cfg.preferences.enableTrayIcon ) {
|
||||||
|
|
Loading…
Reference in a new issue