Commit 30966029 authored by Madhav Kanbur's avatar Madhav Kanbur Committed by Nate Graham
Browse files

Allow disabling Bird's Eye View



BUG: 426105
FIXED-IN: 21.04
Signed-off-by: Madhav Kanbur's avatarMadhav Kanbur <abcdjdj@gmail.com>
parent 1762432c
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="gwenview" version="60">
<gui name="gwenview" version="61">
<MenuBar>
<Menu name="file" >
......@@ -28,6 +28,7 @@
<Action name="view_zoom_to_fit"/>
<Action name="view_zoom_in"/>
<Action name="view_zoom_out"/>
<Action name="view_toggle_birdeyeview"/>
<Separator/>
<Action name="sort_by"/>
<Action name="thumbnail_details"/>
......
......@@ -571,6 +571,7 @@ void ViewMainPage::showContextMenu()
addActionToMenu(&menu, d->mActionCollection, "view_zoom_to_fit");
addActionToMenu(&menu, d->mActionCollection, "view_zoom_in");
addActionToMenu(&menu, d->mActionCollection, "view_zoom_out");
addActionToMenu(&menu, d->mActionCollection, "view_toggle_birdeyeview");
}
if (d->mCompareMode) {
menu.addSeparator();
......
......@@ -269,9 +269,10 @@ the actual pixel size. The shortcut <keycap>F</keycap> toggles between <guibutto
image with the arrow keys. When you zoom in, arrow keys are used to scroll the image.
This is very similar to the behavior provided by phones or digital cameras.</para>
<para>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.</para>
<para>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 <menuchoice><guimenu>View</guimenu><guimenuitem>Show Bird's Eye View When Zoomed In</guimenuitem></menuchoice></para>
<para>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 <guilabel>Zoom mode</guilabel> group on the <guimenuitem>Image View</guimenuitem> page of the &gwenview; configuration window which can be reached using the <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &gwenview;...</guimenuitem></menuchoice>.</para>
......
......@@ -562,7 +562,10 @@ void DocumentView::openUrl(const QUrl &url, const DocumentView::Setup& setup)
} else {
QMetaObject::invokeMethod(this, &DocumentView::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();
......
......@@ -149,6 +149,7 @@ public Q_SLOTS:
void setZoomToFill(bool);
void toggleZoomToFill();
void toggleBirdEyeView();
void setPosition(const QPoint&);
......
......@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <lib/documentview/abstractrasterimageviewtool.h>
#include <lib/slidecontainer.h>
#include <lib/zoomwidget.h>
#include <lib/gwenviewconfig.h>
#include "gwenview_lib_debug.h"
// KF
......@@ -53,6 +54,7 @@ struct DocumentViewControllerPrivate
QAction * mActualSizeAction;
QAction * mZoomInAction;
QAction * mZoomOutAction;
QAction * mToggleBirdEyeViewAction;
QList<QAction *> 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"));
mToggleBirdEyeViewAction->setCheckable(true);
mToggleBirdEyeViewAction->setChecked(GwenviewConfig::birdEyeViewEnabled());
mToggleBirdEyeViewAction->setText(i18n("Show Bird's Eye View When Zoomed In"));
mToggleBirdEyeViewAction->setIcon(QIcon::fromTheme(QStringLiteral("zoom")));
mToggleBirdEyeViewAction->setEnabled(mView != nullptr);
mActions << mZoomToFitAction << mActualSizeAction << mZoomInAction << mZoomOutAction << mZoomToFillAction << mToggleBirdEyeViewAction;
}
void connectZoomWidget()
......@@ -165,6 +174,8 @@ void DocumentViewController::setView(DocumentView* view)
connect(d->mZoomOutAction, SIGNAL(triggered()),
d->mView, SLOT(zoomOut()));
connect(d->mToggleBirdEyeViewAction, &QAction::triggered, d->mView, &DocumentView::toggleBirdEyeView);
d->updateActions();
updateZoomToFitActionFromView();
updateZoomToFillActionFromView();
......
......@@ -34,6 +34,10 @@
</group>
<group name="General">
<entry name="BirdEyeViewEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="ViewBackgroundValue" type="Int">
<default>100</default>
</entry>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment