┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorVishesh Yadav <[email protected]>2011-08-30 18:16:27 +0530
committerVishesh Yadav <[email protected]>2011-08-30 18:16:27 +0530
commit7c99bf5f6b6285c47dc4fa90d2bd2425287747d5 (patch)
tree6891ca8a594379c8af1e12c74f688dfcb47e422c /src/views
parent8a5cf061e1ee091270386db0b006dbbe3865bd79 (diff)
DolphinView zoom with CTRL+MouseWheel REVIEW: 102490
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp11
-rw-r--r--src/views/dolphinview.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 099140177..d00c5c077 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -684,6 +684,17 @@ void DolphinView::contextMenuEvent(QContextMenuEvent* event)
}
}
+void DolphinView::wheelEvent(QWheelEvent* event)
+{
+ if (event->modifiers().testFlag(Qt::ControlModifier)) {
+ const int numDegrees = event->delta() / 8;
+ const int numSteps = numDegrees / 15;
+
+ setZoomLevel(zoomLevel() + numSteps);
+ }
+ event->accept();
+}
+
void DolphinView::activate()
{
setActive(true);
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 7c81ea8fc..085de332d 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -544,6 +544,7 @@ signals:
protected:
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void contextMenuEvent(QContextMenuEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
private slots:
/**