From 4ee9751febb9b67c578f062dcb60f32cf1adb2b5 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 7 Jan 2022 08:36:07 +0300 Subject: [PATCH] Added ability to cancel selection in calendar box with Esc key. --- Telegram/SourceFiles/ui/boxes/calendar_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/boxes/calendar_box.cpp b/Telegram/SourceFiles/ui/boxes/calendar_box.cpp index f8a02902ef..95a1d8cb65 100644 --- a/Telegram/SourceFiles/ui/boxes/calendar_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/calendar_box.cpp @@ -1100,7 +1100,11 @@ void CalendarBox::resizeEvent(QResizeEvent *e) { void CalendarBox::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Escape) { - e->ignore(); + if (_context->selectionMode()) { + _context->toggleSelectionMode(false); + } else { + e->ignore(); + } } else if (e->key() == Qt::Key_Home) { jump(_previous.data()); } else if (e->key() == Qt::Key_End) {