Close payments panel by escape.

This commit is contained in:
John Preston 2021-04-02 15:15:29 +04:00
parent b1c122a260
commit d55d7f37d7
1 changed files with 8 additions and 2 deletions

View File

@ -129,8 +129,14 @@ void SeparatePanel::showAndActivate() {
}
void SeparatePanel::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape && _back->toggled()) {
_synteticBackRequests.fire({});
if (e->key() == Qt::Key_Escape) {
crl::on_main(this, [=] {
if (_back->toggled()) {
_synteticBackRequests.fire({});
} else {
_userCloseRequests.fire({});
}
});
}
return RpWidget::keyPressEvent(e);
}