mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03: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())
|
||||
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
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue