diff --git a/app/configdialog.cpp b/app/configdialog.cpp
--- a/app/configdialog.cpp
+++ b/app/configdialog.cpp
@@ -76,6 +76,7 @@
mWheelBehaviorGroup->setObjectName(QLatin1String("kcfg_MouseWheelBehavior"));
mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelScrollRadioButton, int(MouseWheelBehavior::Scroll));
mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelBrowseRadioButton, int(MouseWheelBehavior::Browse));
+ mWheelBehaviorGroup->addButton(mImageViewConfigPage.mouseWheelZoomRadioButton, int(MouseWheelBehavior::Zoom));
mAnimationMethodGroup = new InvisibleButtonGroup(widget);
mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
diff --git a/app/imageviewconfigpage.ui b/app/imageviewconfigpage.ui
--- a/app/imageviewconfigpage.ui
+++ b/app/imageviewconfigpage.ui
@@ -6,15 +6,15 @@
0
0
- 500
- 650
+ 552
+ 820
-
- Show transparency with:
+ Show &transparency with:
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -24,26 +24,17 @@
- -
-
-
- 6
-
-
- 0
-
+
-
+
-
-
+
- Surrounding background
-
-
- true
+ Vertical
-
-
+
Qt::Horizontal
@@ -57,26 +48,36 @@
- -
-
-
- 6
+
-
+
+
+ Qt::Vertical
-
- 0
+
+ QSizePolicy::Fixed
+
+
+
+ 207
+ 17
+
+
+
+ -
+
-
-
+
- &Checkerboard background
+ Open&GL
- false
+ true
-
-
+
Qt::Horizontal
@@ -90,89 +91,59 @@
- -
-
-
- 6
-
-
- 0
-
-
-
-
-
- &Solid color background:
-
-
-
+ -
+
-
-
-
- false
-
+
-
+ &Keep same zoom and position
-
-
+
Qt::Horizontal
- 20
+ 40
20
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
+
-
+
+
+ 6
-
-
- 207
- 17
-
+
+ 0
-
-
- -
-
-
- Mouse wheel behavior:
+
+ 0
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ 0
-
- mouseWheelScrollRadioButton
+
+ 0
-
-
- -
-
-
-
+
- Scroll
+ Chec&kerboard background
- true
+ false
-
-
+
Qt::Horizontal
@@ -186,17 +157,46 @@
- -
-
+
-
+
+
+ Orientation:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ horizontalRadioButton
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 204
+ 17
+
+
+
+
+ -
+
-
-
+
- Browse
+ Horizontal
-
-
+
Qt::Horizontal
@@ -210,8 +210,21 @@
- -
-
+
-
+
+
+ Mouse wheel behavior:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ mouseWheelScrollRadioButton
+
+
+
+ -
+
Qt::Vertical
@@ -226,33 +239,17 @@
- -
-
-
- Zoom mode:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- autofitZoomModeRadioButton
-
-
-
- -
-
+
-
+
-
-
+
- Autofit each image
-
-
- true
+ Per image zoom and position
-
-
+
Qt::Horizontal
@@ -266,17 +263,17 @@
- -
-
+
-
+
-
-
+
- Keep same zoom and position
+ Browse
-
-
+
Qt::Horizontal
@@ -290,17 +287,30 @@
- -
-
+
-
+
+
+ Row count:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ kcfg_ThumbnailBarRowCount
+
+
+
+ -
+
-
-
+
- Per image zoom and position
+ None
-
-
+
Qt::Horizontal
@@ -314,33 +324,78 @@
- -
-
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 60
+
+
+
+
+ -
+
Qt::Vertical
QSizePolicy::Fixed
- 207
+ 204
17
- -
-
+
-
+
+
+ &Zoom mode:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ autofitZoomModeRadioButton
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 204
+ 12
+
+
+
+
+ -
+
-
-
-
- Enlarge smaller images
+
+
+ 1
+
+
+ 10
-
-
+
Qt::Horizontal
@@ -354,23 +409,14 @@
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 204
- 17
-
+
-
+
+
+ <b>Thumbnail Bar</b>
-
+
- -
+
-
Animations:
@@ -383,20 +429,20 @@
- -
-
+
-
+
-
-
+
- OpenGL
+ Autofit each image
true
-
-
+
Qt::Horizontal
@@ -410,17 +456,17 @@
- -
-
+
-
+
-
-
+
- Software
+ Enlarge smaller images
-
-
+
Qt::Horizontal
@@ -434,17 +480,17 @@
- -
-
+
-
+
-
-
+
- None
+ Software
-
-
+
Qt::Horizontal
@@ -458,69 +504,35 @@
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 204
- 17
-
-
-
-
- -
-
-
- <b>Thumbnail Bar</b>
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
+
-
+
+
+ 6
-
-
- 204
- 12
-
+
+ 0
-
-
- -
-
-
- Orientation:
+
+ 0
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ 0
-
- horizontalRadioButton
+
+ 0
-
-
- -
-
-
-
+
- Horizontal
+ S&urrounding background
+
+
+ true
-
-
+
Qt::Horizontal
@@ -534,17 +546,20 @@
- -
-
+
-
+
-
-
+
- Vertical
+ Scroll
+
+
+ true
-
-
+
Qt::Horizontal
@@ -558,72 +573,103 @@
- -
-
-
- Row count:
+
-
+
+
+ 6
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ 0
-
- kcfg_ThumbnailBarRowCount
+
+ 0
+
+
+ 0
+
+
+ 0
-
-
- -
-
-
-
-
- 1
+
+
+ So&lid color background:
-
- 10
+
+
+ -
+
+
+ false
+
+
+
-
-
+
Qt::Horizontal
- 40
+ 20
20
- -
-
+
-
+
Qt::Vertical
+
+ QSizePolicy::Fixed
+
- 20
- 60
+ 207
+ 17
+ -
+
+
-
+
+
+ &Zoom
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
KColorButton
QPushButton
-
- QSpinBox
- QSpinBox
-
-
checkBoardRadioButton
diff --git a/lib/documentview/documentview.cpp b/lib/documentview/documentview.cpp
--- a/lib/documentview/documentview.cpp
+++ b/lib/documentview/documentview.cpp
@@ -732,7 +732,9 @@
void DocumentView::wheelEvent(QGraphicsSceneWheelEvent* event)
{
- if (d->mAdapter->canZoom() && event->modifiers() & Qt::ControlModifier) {
+ if ((d->mAdapter->canZoom() && event->modifiers() & Qt::ControlModifier) ||
+ (GwenviewConfig::mouseWheelBehavior() == MouseWheelBehavior::Zoom
+ && event->modifiers() == Qt::NoModifier)) {
d->controlWheelAccumulatedDelta += event->delta();
// Ctrl + wheel => zoom in or out
if (d->controlWheelAccumulatedDelta >= QWheelEvent::DefaultDeltasPerStep) {
diff --git a/lib/gwenviewconfig.kcfg b/lib/gwenviewconfig.kcfg
--- a/lib/gwenviewconfig.kcfg
+++ b/lib/gwenviewconfig.kcfg
@@ -136,6 +136,7 @@
+
MouseWheelBehavior::Scroll
diff --git a/lib/mousewheelbehavior.h b/lib/mousewheelbehavior.h
--- a/lib/mousewheelbehavior.h
+++ b/lib/mousewheelbehavior.h
@@ -34,7 +34,8 @@
{
enum Enum {
Scroll,
- Browse
+ Browse,
+ Zoom
};
} // namespace MouseWheelBehavior