Git commit 309660296dbba2f0c7b0bd93f49a91d96029211a by Nate Graham, on behalf
of Madhav Kanbur.
Committed on 01/02/2021 at 17:07.
Pushed by ngraham into branch 'master'.
Allow disabling Bird's Eye View
BUG: 426105
FIXED-IN: 21.04
Signed-off-by: Madhav Kanbur
M +2-1app/gwenviewui.rc
M +1-0app/viewmainpage.cpp
M +4-3doc/index.docbook
M +17 -1lib/documentview/documentview.cpp
M +1-0lib/documentview/documentview.h
M +12 -1lib/documentview/documentviewcontroller.cpp
M +4-0lib/gwenviewconfig.kcfg
https://invent.kde.org/graphics/gwenview/commit/309660296dbba2f0c7b0bd93f49a91d96029211a
diff --git a/app/gwenviewui.rc b/app/gwenviewui.rc
index 299bc50b..fde730f4 100644
--- a/app/gwenviewui.rc
+++ b/app/gwenviewui.rc
@@ -1,6 +1,6 @@
-
+
@@ -28,6 +28,7 @@
+
diff --git a/app/viewmainpage.cpp b/app/viewmainpage.cpp
index 12046977..0324d015 100644
--- a/app/viewmainpage.cpp
+++ b/app/viewmainpage.cpp
@@ -571,6 +571,7 @@ void ViewMainPage::showContextMenu()
addActionToMenu(, d->mActionCollection, "view_zoom_to_fit");
addActionToMenu(, d->mActionCollection, "view_zoom_in");
addActionToMenu(, d->mActionCollection, "view_zoom_out");
+addActionToMenu(, d->mActionCollection,
"view_toggle_birdeyeview");
}
if (d->mCompareMode) {
menu.addSeparator();
diff --git a/doc/index.docbook b/doc/index.docbook
index 8d244d22..abe76126 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -269,9 +269,10 @@ the actual pixel size. The shortcut F
toggles between
-When an image is zoomed in, a bird-eye view appears and lets you scroll
-the image using the mouse and the arrow keys. The bird-eye view automatically
hides
-itself after a short delay, showing back only while zooming or
scrolling.
+When an image is zoomed in, a bird's eye view appears and lets you scroll
+the image using the mouse and the arrow keys. The bird's eye view
automatically hides
+itself after a short delay, showing back only while zooming or scrolling. The
bird's eye view
+can be disabled from the right click context menu or from
ViewShow Bird's Eye View When
Zoomed In
You can define what happens when going to image B after having zoomed in
on an area of image A using the options in the Zoom mode
group on the Image View page of the
configuration window which can be reached using the
SettingsConfigure
diff --git a/lib/documentview/documentview.cpp
b/lib/documentview/documentview.cpp
index 7198415b..1b5ae7c9 100644
--- a/lib/documentview/documentview.cpp
+++ b/lib/documentview/documentview.cpp
@@ -562,7 +562,10 @@ void DocumentView::openUrl(const QUrl , const
DocumentView::Setup& setup)
} else {
QMetaObject::invokeMethod(this, ::finishOpenUrl,
Qt::QueuedConnection);
}
-d->setupBirdEyeView();
+
+if (GwenviewConfig::birdEyeViewEnabled()) {
+d->setupBirdEyeView();
+}
}
void DocumentView::finishOpenUrl()
@@ -670,6 +673,19 @@ void DocumentView::toggleZoomToFill() {
}
}
+void DocumentView::toggleBirdEyeView()
+{
+if (d->mBirdEyeView) {
+ BirdEyeView* tmp = d->mBirdEyeView;
+ d->mBirdEyeView = nullptr;
+ delete tmp;
+} else {
+d->setupBirdEyeView();
+}
+
+
GwenviewConfig::setBirdEyeViewEnabled(!GwenviewConfig::birdEyeViewEnabled());
+}
+
bool DocumentView::zoomToFit() const
{
return d->mAdapter->zoomToFit();
diff --git a/lib/documentview/documentview.h b/lib/documentview/documentview.h
index 99c1dcf6..dcb234bc 100644
--- a/lib/documentview/documentview.h
+++ b/lib/documentview/documentview.h
@@ -149,6 +149,7 @@ public Q_SLOTS:
void setZoomToFill(bool);
void toggleZoomToFill();
+void toggleBirdEyeView();
void setPosition(const QPoint&);
diff --git a/lib/documentview/documentviewcontroller.cpp
b/lib/documentview/documentviewcontroller.cpp
index b3b3dc6f..1bbce1e8 100644
--- a/lib/documentview/documentviewcontroller.cpp
+++ b/lib/documentview/documentviewcontroller.cpp
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge,
MA 02110-1301, USA
#include
#include
#include
+#include
#include "gwenview_lib_debug.h"
// KF
@@ -53,6 +54,7 @@ struct DocumentViewControllerPrivate
QAction * mActualSizeAction;
QAction * mZoomInAction;
QAction * mZoomOutAction;
+QAction * mToggleBirdEyeViewAction;
QList mActions;
void setupActions()
@@ -82,7 +84,14 @@ struct DocumentViewControllerPrivate
mZoomInAction = view->addAction(KStandardAction::ZoomIn);
mZoomOutAction = view->addAction(KStandardAction::ZoomOut);
-mActions << mZoomToFitAction << mActualSizeAction << mZoomInAction <<
mZoomOutAction << mZoomToFillAction;
+mToggleBirdEyeViewAction =
view->addAction(QStringLiteral("view_toggle_birdeyeview"));
+