From 322792ea0426ab858997a1d541a9af9ec47ab8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 6 Apr 2017 19:54:50 +0200 Subject: [PATCH] Improved digital zoom/fullscreen interaction --- src/gui.cpp | 2 ++ src/pathview.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui.cpp b/src/gui.cpp index c44516f3..ebae2aa5 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -1318,6 +1318,7 @@ void GUI::keyPressEvent(QKeyEvent *event) if (_fullscreenAction->isChecked()) { _fullscreenAction->setChecked(false); showFullscreen(false); + return; } break; } @@ -1326,6 +1327,7 @@ void GUI::keyPressEvent(QKeyEvent *event) if (!(event->modifiers() & MODIFIER)) closeFiles(); openFile(file); + return; } QMainWindow::keyPressEvent(event); diff --git a/src/pathview.cpp b/src/pathview.cpp index ec6f7f68..46d4a25e 100644 --- a/src/pathview.cpp +++ b/src/pathview.cpp @@ -457,10 +457,10 @@ void PathView::keyPressEvent(QKeyEvent *event) z = 1; else if (event->matches(ZOOM_OUT)) z = -1; - else { - if (_digitalZoom && event->key() == Qt::Key_Escape ) - resetDigitalZoom(); - + else if (_digitalZoom && event->key() == Qt::Key_Escape) { + resetDigitalZoom(); + return; + } else { QGraphicsView::keyPressEvent(event); return; }