Skip to content

Commit

Permalink
qt: Use GUIUtil::bringToFront where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Nov 5, 2018
1 parent 5796671 commit 6fc21ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
26 changes: 5 additions & 21 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,7 @@ void BitcoinGUI::aboutClicked()

void BitcoinGUI::showDebugWindow()
{
rpcConsole->showNormal();
rpcConsole->show();
rpcConsole->raise();
rpcConsole->activateWindow();
GUIUtil::bringToFront(rpcConsole);
}

void BitcoinGUI::showDebugWindowActivateConsole()
Expand Down Expand Up @@ -1152,24 +1149,11 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
if(!clientModel)
return;

// 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 if(fToggleHidden)
if (!isHidden() && !isMinimized() && !GUIUtil::isObscured(this) && fToggleHidden) {
hide();
} else {
GUIUtil::bringToFront(this);
}
}

void BitcoinGUI::toggleHidden()
Expand Down
8 changes: 2 additions & 6 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,15 @@ void WalletView::usedSendingAddresses()
if(!walletModel)
return;

usedSendingAddressesPage->show();
usedSendingAddressesPage->raise();
usedSendingAddressesPage->activateWindow();
GUIUtil::bringToFront(usedSendingAddressesPage);
}

void WalletView::usedReceivingAddresses()
{
if(!walletModel)
return;

usedReceivingAddressesPage->show();
usedReceivingAddressesPage->raise();
usedReceivingAddressesPage->activateWindow();
GUIUtil::bringToFront(usedReceivingAddressesPage);
}

void WalletView::showProgress(const QString &title, int nProgress)
Expand Down

0 comments on commit 6fc21ac

Please sign in to comment.