UI: Tray Menu: Handle mouse release event only after pressed

This commit is contained in:
Nodir Temirkhodjaev 2024-01-10 12:49:26 +03:00
parent b55e1fd67b
commit 447e5fe336
2 changed files with 3 additions and 3 deletions

View File

@ -16,13 +16,13 @@ void ClickableMenu::mousePressEvent(QMouseEvent *event)
void ClickableMenu::mouseReleaseEvent(QMouseEvent *event)
{
QMenu::mouseReleaseEvent(event);
if (!m_pressed)
return;
m_pressed = false;
QMenu::mouseReleaseEvent(event);
if (isVisible()) {
emit clicked();
}

View File

@ -362,7 +362,7 @@ void TrayIcon::setupUi()
void TrayIcon::setupTrayMenu()
{
m_menu = ControlUtil::createMenu(windowManager()->mainWindow());
m_menu = new ClickableMenu(windowManager()->mainWindow());
m_homeAction = addAction(
m_menu, ":/icons/fort.png", windowManager(), SLOT(showHomeWindow()), ActionShowHome);