diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-07-15 10:44:19 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-07-15 10:47:09 +0100 |
commit | 6ae903e24afa95214e59a9dc87dc74db3535a5b5 (patch) | |
tree | 463e568e13d04b91e922fd5e01173e3c95ae1da5 /src | |
parent | 01ed4927f09fc8408bd81b8286303dfeefd0523f (diff) | |
parent | 992b1bbd5da95ee782515fb0f5674bb7a02684b2 (diff) |
Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible
992b1bbd5da95ee782515fb0f5674bb7a02684b2 qt: keep focus on "Hide" while ModalOverlay is visible (Jadi)
Pull request description:
During the initial sync, the Tab moves the focus to the widgets of the main window, even when the ModalOverlay is visible. This creates some weird rectangular *selections on the screen*.
This PR fixes this by keeping the focus on the "Hide" button while the ModalOverlay is visible.
Fixes #783
ACKs for top commit:
pablomartin4btc:
Concept & approach ACK 992b1bbd5da95ee782515fb0f5674bb7a02684b2
hebasto:
re-ACK 992b1bbd5da95ee782515fb0f5674bb7a02684b2
Tree-SHA512: f702a3fd51db4bc10780bccf76394e35a6b5fb45db72c9c23cd10d777106b08c61077d2d989003838921e76d2cb44f809399f31df76448e4305a6c2a71b5c6a3
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/modaloverlay.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp index 7bc6ccdc49..7580f6b47a 100644 --- a/src/qt/modaloverlay.cpp +++ b/src/qt/modaloverlay.cpp @@ -25,6 +25,7 @@ ModalOverlay::ModalOverlay(bool enable_wallet, QWidget* parent) parent->installEventFilter(this); raise(); } + ui->closeButton->installEventFilter(this); blockProcessTime.clear(); setVisible(false); @@ -60,6 +61,11 @@ bool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) { raise(); } } + + if (obj == ui->closeButton && ev->type() == QEvent::FocusOut && layerIsVisible) { + ui->closeButton->setFocus(Qt::OtherFocusReason); + } + return QWidget::eventFilter(obj, ev); } @@ -187,6 +193,10 @@ void ModalOverlay::showHide(bool hide, bool userRequested) m_animation.setEndValue(QPoint(0, hide ? height() : 0)); m_animation.start(QAbstractAnimation::KeepWhenStopped); layerIsVisible = !hide; + + if (layerIsVisible) { + ui->closeButton->setFocus(Qt::OtherFocusReason); + } } void ModalOverlay::closeClicked() |