mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-18 12:53:03 +02:00
Merge bitcoin-core/gui#30: Disable the main window toolbar when the modal overlay is shown
d0cc1f6df740e03ca0213a3754c3277b01ae2c05 qt: Disable toolbar when overlay is shown (Hennadii Stepanov) e74cd2083d579b14b0b718aa36796f2bcf679600 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 #22. --- On master (ca055885c631de8ac0ffe24be6b02835dbcc039d):  With this PR:  ACKs for top commit: harding: Tested ACK d0cc1f6df740e03ca0213a3754c3277b01ae2c05. 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 d0cc1f6df740e03ca0213a3754c3277b01ae2c05 tested on Ubuntu 18.04.4 LTS Tree-SHA512: e371b34231c01e77118deb100e0f280ba1cdef54e317f7f7d6ac322598bda811bd1bfe3035e90d87f8267f4f5d2095d34a8136911159db63694fd1b1b11335a1
This commit is contained in:
commit
d52bfc4916
@ -112,6 +112,8 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
Q_EMIT consoleShown(rpcConsole);
|
Q_EMIT consoleShown(rpcConsole);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
|
||||||
|
|
||||||
// Accept D&D of URIs
|
// Accept D&D of URIs
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
@ -201,7 +203,6 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK);
|
openOptionsDialogWithTab(OptionsDialog::TAB_NETWORK);
|
||||||
});
|
});
|
||||||
|
|
||||||
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
|
|
||||||
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
|
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &BitcoinGUI::showModalOverlay);
|
||||||
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
|
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &BitcoinGUI::showModalOverlay);
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
@ -238,6 +239,7 @@ BitcoinGUI::~BitcoinGUI()
|
|||||||
void BitcoinGUI::createActions()
|
void BitcoinGUI::createActions()
|
||||||
{
|
{
|
||||||
QActionGroup *tabGroup = new QActionGroup(this);
|
QActionGroup *tabGroup = new QActionGroup(this);
|
||||||
|
connect(modalOverlay, &ModalOverlay::triggered, tabGroup, &QActionGroup::setEnabled);
|
||||||
|
|
||||||
overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this);
|
overviewAction = new QAction(platformStyle->SingleColorIcon(":/icons/overview"), tr("&Overview"), this);
|
||||||
overviewAction->setStatusTip(tr("Show general overview of wallet"));
|
overviewAction->setStatusTip(tr("Show general overview of wallet"));
|
||||||
|
@ -171,6 +171,8 @@ void ModalOverlay::showHide(bool hide, bool userRequested)
|
|||||||
if ( (layerIsVisible && !hide) || (!layerIsVisible && hide) || (!hide && userClosed && !userRequested))
|
if ( (layerIsVisible && !hide) || (!layerIsVisible && hide) || (!hide && userClosed && !userRequested))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Q_EMIT triggered(hide);
|
||||||
|
|
||||||
if (!isVisible() && !hide)
|
if (!isVisible() && !hide)
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
|
||||||
|
@ -25,16 +25,20 @@ public:
|
|||||||
explicit ModalOverlay(bool enable_wallet, QWidget *parent);
|
explicit ModalOverlay(bool enable_wallet, QWidget *parent);
|
||||||
~ModalOverlay();
|
~ModalOverlay();
|
||||||
|
|
||||||
public Q_SLOTS:
|
|
||||||
void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
|
void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
|
||||||
void setKnownBestHeight(int count, const QDateTime& blockDate);
|
void setKnownBestHeight(int count, const QDateTime& blockDate);
|
||||||
|
|
||||||
void toggleVisibility();
|
|
||||||
// will show or hide the modal layer
|
// will show or hide the modal layer
|
||||||
void showHide(bool hide = false, bool userRequested = false);
|
void showHide(bool hide = false, bool userRequested = false);
|
||||||
void closeClicked();
|
|
||||||
bool isLayerVisible() const { return layerIsVisible; }
|
bool isLayerVisible() const { return layerIsVisible; }
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void toggleVisibility();
|
||||||
|
void closeClicked();
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void triggered(bool hidden);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject * obj, QEvent * ev) override;
|
bool eventFilter(QObject * obj, QEvent * ev) override;
|
||||||
bool event(QEvent* ev) override;
|
bool event(QEvent* ev) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user