mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Change behavior when tray icon is clicked
qBittorrent will be hidden only when it is in focus.
This commit is contained in:
parent
0f40fad74d
commit
8c9ec7ec6a
1 changed files with 17 additions and 1 deletions
|
@ -399,7 +399,23 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||||
if (!isVisible())
|
if (!isVisible())
|
||||||
activate();
|
activate();
|
||||||
#else
|
#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
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue