mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
qt: keep focus on "Hide" while ModalOverlay is visible
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
This commit is contained in:
parent
baed5edeb6
commit
992b1bbd5d
1 changed files with 10 additions and 0 deletions
|
@ -23,6 +23,7 @@ ModalOverlay::ModalOverlay(bool enable_wallet, QWidget* parent)
|
|||
parent->installEventFilter(this);
|
||||
raise();
|
||||
}
|
||||
ui->closeButton->installEventFilter(this);
|
||||
|
||||
blockProcessTime.clear();
|
||||
setVisible(false);
|
||||
|
@ -58,6 +59,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);
|
||||
}
|
||||
|
||||
|
@ -185,6 +191,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