Skip to content

Commit c113d22

Browse files
hebastoPiRK
authored andcommitted
Disable the main window toolbar when the modal overlay is shown
Summary: > qt, refactor: Cleanup ModalOverlay slots > qt: Disable toolbar when overlay is shown This is a backport of [[bitcoin-core/gui#30 | core-gui#30]] Test Plan: `bitcoin-qt --regtest Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D9994
1 parent 06a8d18 commit c113d22

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/qt/bitcoingui.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node &node, const Config *configIn,
110110
Q_EMIT consoleShown(rpcConsole);
111111
}
112112

113+
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
114+
113115
// Accept D&D of URIs
114116
setAcceptDrops(true);
115117

@@ -203,7 +205,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node &node, const Config *configIn,
203205
connect(labelProxyIcon, &GUIUtil::ClickableLabel::clicked,
204206
[this] { openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK); });
205207

206-
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
207208
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this,
208209
&BitcoinGUI::showModalOverlay);
209210
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this,
@@ -243,6 +244,8 @@ BitcoinGUI::~BitcoinGUI() {
243244

244245
void BitcoinGUI::createActions() {
245246
QActionGroup *tabGroup = new QActionGroup(this);
247+
connect(modalOverlay, &ModalOverlay::triggered, tabGroup,
248+
&QActionGroup::setEnabled);
246249

247250
overviewAction =
248251
new QAction(platformStyle->SingleColorIcon(":/icons/overview"),

src/qt/modaloverlay.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ void ModalOverlay::showHide(bool hide, bool userRequested) {
190190
return;
191191
}
192192

193+
Q_EMIT triggered(hide);
194+
193195
if (!isVisible() && !hide) {
194196
setVisible(true);
195197
}

src/qt/modaloverlay.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@ 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,
3029
double nVerificationProgress);
3130
void setKnownBestHeight(int count, const QDateTime &blockDate);
3231

33-
void toggleVisibility();
3432
// will show or hide the modal layer
3533
void showHide(bool hide = false, bool userRequested = false);
36-
void closeClicked();
3734
bool isLayerVisible() const { return layerIsVisible; }
3835

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

0 commit comments

Comments
 (0)