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
This commit is contained in:
thunder2 2011-11-25 11:07:54 +00:00
parent 379927a846
commit a124c928d5

View File

@ -1209,13 +1209,13 @@ void MainWindow::closeEvent(QCloseEvent *e)
void MainWindow::updateMenu() void MainWindow::updateMenu()
{ {
toggleVisibilityAction->setText(isVisible() ? tr("Hide") : tr("Show")); toggleVisibilityAction->setText(isVisible() && !isMinimized() ? tr("Hide") : tr("Show"));
} }
void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e) void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e)
{ {
if (e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) { if (e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) {
if(isHidden()){ if (isHidden() || isMinimized()) {
show(); show();
if (isMinimized()) { if (isMinimized()) {
if (isMaximized()) { if (isMaximized()) {
@ -1277,7 +1277,7 @@ void MainWindow::trayIconTransfersClicked(QSystemTrayIcon::ActivationReason e)
void MainWindow::toggleVisibilitycontextmenu() void MainWindow::toggleVisibilitycontextmenu()
{ {
if (isVisible()) if (isVisible() && !isMinimized())
hide(); hide();
else else
show(); show();