mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 13:07:38 +03:00
Robust processing of tray icon triggers
* Support double click on tray icon to always toggle window to/from tray * Single click on tray icon will bring window to front if in background, otherwise window is toggled * Fixes #2956
This commit is contained in:
parent
ebe6649683
commit
faf7a2bbb3
3 changed files with 56 additions and 7 deletions
|
@ -1286,11 +1286,11 @@ void TestGui::testTrayRestoreHide()
|
|||
QSKIP("QSystemTrayIcon::isSystemTrayAvailable() = false, skipping tray restore/hide test...");
|
||||
}
|
||||
|
||||
m_mainWindow->hideWindow();
|
||||
QVERIFY(!m_mainWindow->isVisible());
|
||||
|
||||
auto* trayIcon = m_mainWindow->findChild<QSystemTrayIcon*>();
|
||||
QVERIFY(m_mainWindow->isVisible());
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||
QTRY_VERIFY(!m_mainWindow->isVisible());
|
||||
QVERIFY(trayIcon);
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||
QTRY_VERIFY(m_mainWindow->isVisible());
|
||||
|
@ -1298,8 +1298,17 @@ void TestGui::testTrayRestoreHide()
|
|||
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||
QTRY_VERIFY(!m_mainWindow->isVisible());
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::Trigger);
|
||||
trayIcon->activated(QSystemTrayIcon::MiddleClick);
|
||||
QTRY_VERIFY(m_mainWindow->isVisible());
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::MiddleClick);
|
||||
QTRY_VERIFY(!m_mainWindow->isVisible());
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::DoubleClick);
|
||||
QTRY_VERIFY(m_mainWindow->isVisible());
|
||||
|
||||
trayIcon->activated(QSystemTrayIcon::DoubleClick);
|
||||
QTRY_VERIFY(!m_mainWindow->isVisible());
|
||||
}
|
||||
|
||||
int TestGui::addCannedEntries()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue