Change behavior when tray icon is clicked

qBittorrent will be hidden only when it is in focus.
This commit is contained in:
eretrus@outlook.com 2023-11-13 20:57:38 +02:00
parent 0f40fad74d
commit 8c9ec7ec6a

View file

@ -399,7 +399,23 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
if (!isVisible())
activate();
#else
toggleVisibility();
if (isActiveWindow())
{
hide();
}
else
{
if (m_uiLocked && !unlockUI()) // Ask for UI lock password
return;
// Make sure the window is not minimized
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
// Then show it
show();
raise();
activateWindow();
}
#endif
});