mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:25:40 +00:00
UI: Tray Menu: Handle mouse release event only after pressed
This commit is contained in:
parent
b55e1fd67b
commit
447e5fe336
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user