Skip to content

Commit d52bfc4

Browse files
author
MarcoFalke
committed
Merge bitcoin-core/gui#30: Disable the main window toolbar when the modal overlay is shown
d0cc1f6 qt: Disable toolbar when overlay is shown (Hennadii Stepanov) e74cd20 qt, refactor: Cleanup ModalOverlay slots (Hennadii Stepanov) Pull request description: Keeping the main window toolbar activated while the modal overlay is shown could create the appearance of the non-responsive GUI. Fixes bitpay#22. --- On master (ca05588): ![Screenshot from 2020-07-11 13-07-00](https://user-images.githubusercontent.com/32963518/87221791-7504e100-c377-11ea-9689-ddd4b21b98f9.png) With this PR: ![Screenshot from 2020-07-11 13-07-39](https://user-images.githubusercontent.com/32963518/87221803-8817b100-c377-11ea-92c8-3602dc4d2451.png) ACKs for top commit: harding: Tested ACK d0cc1f6. Tested on Linux/X11 as much as I could given it's a pretty small change; seems like a nice improvement. I'm not experienced in Qt, but I don't see anything obviously problematic about the code. jonatack: ACK d0cc1f6 tested on Debian 5.7.6-1 (2020-06-24) x86_64 GNU/Linux LarryRuane: ACK d0cc1f6 tested on Ubuntu 18.04.4 LTS Tree-SHA512: e371b34231c01e77118deb100e0f280ba1cdef54e317f7f7d6ac322598bda811bd1bfe3035e90d87f8267f4f5d2095d34a8136911159db63694fd1b1b11335a1
2 parents 631284f + d0cc1f6 commit d52bfc4

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/qt/bitcoingui.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
112112
Q_EMIT consoleShown(rpcConsole);
113113
}
114114

115+
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
116+
115117
// Accept D&D of URIs
116118
setAcceptDrops(true);
117119

@@ -201,7 +203,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
201203
openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK);
202204
});
203205

204-
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
205206
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
206207
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
207208
#ifdef ENABLE_WALLET
@@ -238,6 +239,7 @@ BitcoinGUI::~BitcoinGUI()
238239
void BitcoinGUI::createActions()
239240
{
240241
QActionGroup *tabGroup = new QActionGroup(this);
242+
connect(modalOverlay, &ModalOverlay::triggered, tabGroup, &QActionGroup::setEnabled);
241243

242244
overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this);
243245
overviewAction->setStatusTip(tr("Show general overview of wallet"));

src/qt/modaloverlay.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ void ModalOverlay::showHide(bool hide, bool userRequested)
171171
if ( (layerIsVisible && !hide) || (!layerIsVisible && hide) || (!hide && userClosed && !userRequested))
172172
return;
173173

174+
Q_EMIT triggered(hide);
175+
174176
if (!isVisible() && !hide)
175177
setVisible(true);
176178

src/qt/modaloverlay.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@ class ModalOverlay : public QWidget
2525
explicit ModalOverlay(bool enable_wallet, QWidget *parent);
2626
~ModalOverlay();
2727

28-
public Q_SLOTS:
2928
void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
3029
void setKnownBestHeight(int count, const QDateTime& blockDate);
3130

32-
void toggleVisibility();
3331
// will show or hide the modal layer
3432
void showHide(bool hide = false, bool userRequested = false);
35-
void closeClicked();
3633
bool isLayerVisible() const { return layerIsVisible; }
3734

35+
public Q_SLOTS:
36+
void toggleVisibility();
37+
void closeClicked();
38+
39+
Q_SIGNALS:
40+
void triggered(bool hidden);
41+
3842
protected:
3943
bool eventFilter(QObject * obj, QEvent * ev) override;
4044
bool event(QEvent* ev) override;

0 commit comments

Comments
 (0)