┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorLuciano Montanaro <[email protected]>2008-02-12 09:27:26 +0000
committerLuciano Montanaro <[email protected]>2008-02-12 09:27:26 +0000
commit4caebde3cb9e31fcb18b36e45afa287e9c03abd4 (patch)
treedcefcca624c0746f82f7512de42278783ed7885c /src/dolphiniconsview.cpp
parentbad99f25fee78ccf36971da00e3ef18d493c22fe (diff)
Move the Ctrl-wheel zoom handling to dolphinview.
The specialized views still need to ignore the Ctrl-qualified wheel events, though. svn path=/trunk/KDE/kdebase/apps/; revision=773976
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index ccf12a737..ccf4cbfc5 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -297,29 +297,24 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
void DolphinIconsView::wheelEvent(QWheelEvent* event)
{
- KCategorizedView::wheelEvent(event);
-
+ // let Ctrl+wheel events propagate to the DolphinView for icon zooming
if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
- int d = event->delta();
- if (d > 0) {
- zoomIn();
- } else if (d < 0) {
- zoomOut();
- }
- } else {
- // if the icons are aligned left to right, the vertical wheel event should
- // be applied to the horizontal scrollbar
- const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
- const bool scrollHorizontal = (event->orientation() == Qt::Vertical) &&
- (settings->arrangement() == QListView::LeftToRight);
- if (scrollHorizontal) {
- QWheelEvent horizEvent(event->pos(),
- event->delta(),
- event->buttons(),
- event->modifiers(),
- Qt::Horizontal);
- QApplication::sendEvent(horizontalScrollBar(), &horizEvent);
- }
+ event->ignore();
+ return;
+ }
+ KCategorizedView::wheelEvent(event);
+ // if the icons are aligned left to right, the vertical wheel event should
+ // be applied to the horizontal scrollbar
+ const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
+ const bool scrollHorizontal = (event->orientation() == Qt::Vertical) &&
+ (settings->arrangement() == QListView::LeftToRight);
+ if (scrollHorizontal) {
+ QWheelEvent horizEvent(event->pos(),
+ event->delta(),
+ event->buttons(),
+ event->modifiers(),
+ Qt::Horizontal);
+ QApplication::sendEvent(horizontalScrollBar(), &horizEvent);
}
}