mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible
992b1bbd5d
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 ACK992b1bbd5d
hebasto: re-ACK992b1bbd5d
Tree-SHA512: f702a3fd51db4bc10780bccf76394e35a6b5fb45db72c9c23cd10d777106b08c61077d2d989003838921e76d2cb44f809399f31df76448e4305a6c2a71b5c6a3
This commit is contained in:
commit
6ae903e24a
1 changed files with 10 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue