From a124c928d59300414d8e93d012ee9e85851e9e30 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 25 Nov 2011 11:07:54 +0000 Subject: [PATCH] Show main window with click on system icon when the main window is minimized. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4688 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 48383c707..9935e9aee 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -1209,16 +1209,16 @@ void MainWindow::closeEvent(QCloseEvent *e) void MainWindow::updateMenu() { - toggleVisibilityAction->setText(isVisible() ? tr("Hide") : tr("Show")); + toggleVisibilityAction->setText(isVisible() && !isMinimized() ? tr("Hide") : tr("Show")); } void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) { - if(e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick){ - if(isHidden()){ + if (e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) { + if (isHidden() || isMinimized()) { show(); - if(isMinimized()){ - if(isMaximized()){ + if (isMinimized()) { + if (isMaximized()) { showMaximized(); }else{ showNormal(); @@ -1226,7 +1226,7 @@ void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) } raise(); activateWindow(); - }else{ + } else { hide(); } } @@ -1277,7 +1277,7 @@ void MainWindow::trayIconTransfersClicked(QSystemTrayIcon::ActivationReason e) void MainWindow::toggleVisibilitycontextmenu() { - if (isVisible()) + if (isVisible() && !isMinimized()) hide(); else show();