┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-01-17 18:50:18 +0000
committerPeter Penz <[email protected]>2008-01-17 18:50:18 +0000
commite89b4021ad8eaaa84a63209a0ea626a0203109af (patch)
tree58d2ffe91ea9ac33519fee0293473cd1fc70a023 /src/dolphiniconsview.cpp
parent1cc7d60fb951a6933e6e20739a06e4bb64643c14 (diff)
if the icons are aligned left to right, the vertical wheel event should be applied to the horizontal scrollbar
BUG: 153343 svn path=/trunk/KDE/kdebase/apps/; revision=762722
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index 553cdcfe6..21debe745 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -33,6 +33,7 @@
#include <QApplication>
#include <QPainter>
#include <QPoint>
+#include <QScrollBar>
DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
KCategorizedView(parent),
@@ -285,6 +286,25 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
}
}
+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);
+ }
+}
+
void DolphinIconsView::triggerItem(const QModelIndex& index)
{
m_controller->triggerItem(itemForIndex(index));