Added ability to cancel selection in calendar box with Esc key.

This commit is contained in:
23rd 2022-01-07 08:36:07 +03:00 committed by John Preston
parent 46fb5ee1d2
commit 4ee9751feb
1 changed files with 5 additions and 1 deletions

View File

@ -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) {