aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2012-06-05 07:23:26 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2012-06-12 22:15:35 +0200
commitd2e6dd6c993946b2d48f4cd8777704549af9ea78 (patch)
treee6ac2b5689d9b2d0237a8b5452b4cf2f8b12ae07 /src/qt/bitcoingui.cpp
parent12718ce767accf71652cee34ad2003f95deb6e55 (diff)
merge toggleHidden() code into showNormalIfMinimized() to extend the functionality, but keep a simpler toggleHidden() for use in SLOT() macro
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp50
1 files changed, 22 insertions, 28 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 546a39f43d..e15bc6690a 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -439,28 +439,6 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
}
#endif
-void BitcoinGUI::toggleHidden()
-{
- // activateWindow() (sometimes) helps with keyboard focus on Windows
- if (isHidden())
- {
- show();
- activateWindow();
- }
- else if (isMinimized())
- {
- showNormal();
- activateWindow();
- }
- else if (GUIUtil::isObscured(this))
- {
- raise();
- activateWindow();
- }
- else
- hide();
-}
-
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
@@ -782,9 +760,6 @@ void BitcoinGUI::handleURI(QString strURI)
gotoSendCoinsPage();
sendCoinsPage->handleURI(strURI);
- if(!isActiveWindow())
- activateWindow();
-
showNormalIfMinimized();
}
@@ -867,10 +842,29 @@ void BitcoinGUI::unlockWallet()
}
}
-void BitcoinGUI::showNormalIfMinimized()
+void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
{
- if(!isVisible()) // Show, if hidden
+ // activateWindow() (sometimes) helps with keyboard focus on Windows
+ if (isHidden())
+ {
show();
- if(isMinimized()) // Unminimize, if minimized
+ activateWindow();
+ }
+ else if (isMinimized())
+ {
showNormal();
+ activateWindow();
+ }
+ else if (GUIUtil::isObscured(this))
+ {
+ raise();
+ activateWindow();
+ }
+ else if(fToggleHidden)
+ hide();
+}
+
+void BitcoinGUI::toggleHidden()
+{
+ showNormalIfMinimized(true);
}