From c45dc79d8347626ddb44a0ce55c71a8a71116403 Mon Sep 17 00:00:00 2001 From: aleksusklim Date: Mon, 10 May 2021 15:45:47 +0500 Subject: [PATCH] More hotkeys to zoom images in viewer: Plus, Minus and Asterisk without Ctrl key; alias Enter and Space to reset zoom level for simple photos --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 13d934f7539c6c..65dba9ec9f0219 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -3631,6 +3631,8 @@ void OverlayWidget::keyPressEvent(QKeyEvent *e) { playbackPauseResume(); } else if (_document && !_document->loading() && (documentBubbleShown() || !_documentMedia->loaded())) { onDocClick(); + } else { + zoomReset(); } } else if (e->key() == Qt::Key_Left) { if (_controlsHideTimer.isActive()) { @@ -3652,6 +3654,12 @@ void OverlayWidget::keyPressEvent(QKeyEvent *e) { } else if (e->key() == Qt::Key_I) { update(); } + } else if (e->key() == Qt::Key_Plus) { + zoomIn(); + } else if (e->key() == Qt::Key_Minus) { + zoomOut(); + } else if (e->key() == Qt::Key_Asterisk) { + zoomReset(); } }