summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-09-01 18:36:02 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-09-01 18:36:02 (GMT)
commit776c7f67e845e9193993cec42fa60b2e418e9c75 (patch)
treeccca6a28dc6fbf46e0960616e6a066e540dd922a /Swift/QtUI
parentfc049089490fd2b7a3693da782eb8ac11a86e26b (diff)
downloadswift-776c7f67e845e9193993cec42fa60b2e418e9c75.zip
swift-776c7f67e845e9193993cec42fa60b2e418e9c75.tar.bz2
Fix show/hide behavior of SystemTray.
Show now brings the window to front and activates it. Clicking on the tray hides the application if it is visible.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp11
-rw-r--r--Swift/QtUI/QtLoginWindow.h1
-rw-r--r--Swift/QtUI/QtLoginWindowFactory.cpp2
3 files changed, 13 insertions, 1 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 2a25420..9694364 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -169,4 +169,15 @@ void QtLoginWindow::setMessage(const String& message) {
}
}
+void QtLoginWindow::bringToFront() {
+ if (isHidden()) {
+ showNormal();
+ raise();
+ activateWindow();
+ }
+ else {
+ hide();
+ }
+}
+
}
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index 1c156db..144f212 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -29,6 +29,7 @@ namespace Swift {
void handleCertficateChecked(bool);
void handleQuit();
void handleAbout();
+ void bringToFront();
private:
void setInitialMenus();
diff --git a/Swift/QtUI/QtLoginWindowFactory.cpp b/Swift/QtUI/QtLoginWindowFactory.cpp
index c150892..2405dd6 100644
--- a/Swift/QtUI/QtLoginWindowFactory.cpp
+++ b/Swift/QtUI/QtLoginWindowFactory.cpp
@@ -13,7 +13,7 @@ LoginWindow* QtLoginWindowFactory::createLoginWindow(const String& defaultJID, c
if (splitter_) {
splitter_->insertWidget(0, window);
}
- connect(systemTray_, SIGNAL(clicked()), window, SLOT(show()));
+ connect(systemTray_, SIGNAL(clicked()), window, SLOT(bringToFront()));
return window;
}
}