┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciano Montanaro <[email protected]>2008-02-01 22:33:06 +0000
committerLuciano Montanaro <[email protected]>2008-02-01 22:33:06 +0000
commita3003c2c94e34abefe1974633aa7c22734202cf6 (patch)
treeeda84e321a6d4cf65c36cf2975eeaa244a70105e
parentb94f5e3923fecbde073705b9b11d3971686df93a (diff)
Zoom in and out the icon view on Ctrl+Mouse wheel.
CCMAIL: [email protected] --This li.Ine, and those below, will be ignored-- M src/dolphiniconsview.cpp svn path=/trunk/KDE/kdebase/apps/; revision=769728
-rw-r--r--src/dolphiniconsview.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 9e4a2604b..ccf12a737 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -299,18 +299,27 @@ void DolphinIconsView::wheelEvent(QWheelEvent* event)
{
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);
+ 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);
+ }
}
}