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
|
else
|
||||||
if ( !onlyShow )
|
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)
|
if (cfg.preferences.enableTrayIcon)
|
||||||
hide();
|
hide();
|
||||||
else
|
else
|
||||||
showMinimized();
|
showMinimized();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if( headwordsDlg )
|
if( headwordsDlg )
|
||||||
headwordsDlg->hide();
|
headwordsDlg->hide();
|
||||||
|
|
Loading…
Reference in a new issue