From d55d7f37d7e3a526cd7d9213c5b43778e54881d8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 2 Apr 2021 15:15:29 +0400 Subject: [PATCH] Close payments panel by escape. --- Telegram/SourceFiles/ui/widgets/separate_panel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp index 798c825d55..69e67fdcee 100644 --- a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp +++ b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp @@ -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); }