mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
fix: Unsatisfactory "Close To Tray" behavior on macOS
This commit is contained in:
parent
8ffa1f6643
commit
e2bd010b19
|
@ -2922,10 +2922,23 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
|||
else
|
||||
if ( !onlyShow )
|
||||
{
|
||||
|
||||
// On Windows and Linux, a hidden window won't show a task bar icon
|
||||
// When trayicon is enabled, the duplication is unneeded
|
||||
|
||||
// On macOS, a hidden window will still show on the Dock,
|
||||
// but click it won't bring it back, thus we can only minimize it.
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
if (cfg.preferences.enableTrayIcon)
|
||||
showMinimized();
|
||||
#else
|
||||
if (cfg.preferences.enableTrayIcon)
|
||||
hide();
|
||||
hide();
|
||||
else
|
||||
showMinimized();
|
||||
showMinimized();
|
||||
#endif
|
||||
|
||||
|
||||
if( headwordsDlg )
|
||||
headwordsDlg->hide();
|
||||
|
|
Loading…
Reference in a new issue