1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Do not do anything when middle clicking on the tray

This commit is contained in:
Anatoliy Zinovyev 2015-11-25 12:11:31 -05:00
parent fc462e82df
commit 6bbca9341d

View File

@ -734,44 +734,30 @@ void Widget::confirmExecutableOpen(const QFileInfo &file)
void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason) void Widget::onIconClick(QSystemTrayIcon::ActivationReason reason)
{ {
switch (reason) if (reason == QSystemTrayIcon::Trigger)
{ {
case QSystemTrayIcon::Trigger: if (isHidden() || isMinimized())
{ {
if (isHidden() || isMinimized()) if (wasMaximized)
{ showMaximized();
if (wasMaximized)
showMaximized();
else
showNormal();
activateWindow();
}
else if (!isActiveWindow())
{
activateWindow();
}
else else
{ showNormal();
wasMaximized = isMaximized();
hide();
}
break; activateWindow();
} }
case QSystemTrayIcon::MiddleClick: else if (!isActiveWindow())
{
activateWindow();
}
else
{
wasMaximized = isMaximized(); wasMaximized = isMaximized();
if (Settings::getInstance().getMinimizeToTray()) hide();
hide(); }
else }
showMinimized(); else if (reason == QSystemTrayIcon::Unknown)
break; {
case QSystemTrayIcon::Unknown: forceShow();
if (isHidden())
forceShow();
break;
default:
break;
} }
} }