┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphincolumnview.cpp10
-rw-r--r--src/dolphincolumnview.h1
-rw-r--r--src/dolphincolumnwidget.cpp10
-rw-r--r--src/dolphincolumnwidget.h1
-rw-r--r--src/dolphindetailsview.cpp10
-rw-r--r--src/dolphindetailsview.h1
-rw-r--r--src/dolphiniconsview.cpp39
-rw-r--r--src/dolphinview.cpp14
-rw-r--r--src/dolphinview.h1
9 files changed, 65 insertions, 22 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp
index 907daa0d6..7257cd830 100644
--- a/src/dolphincolumnview.cpp
+++ b/src/dolphincolumnview.cpp
@@ -338,6 +338,16 @@ void DolphinColumnView::resizeEvent(QResizeEvent* event)
assureVisibleActiveColumn();
}
+void DolphinColumnView::wheelEvent(QWheelEvent* event)
+{
+ // let Ctrl+wheel events propagate to the DolphinView for icon zooming
+ if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
+ event->ignore();
+ return;
+ }
+ QAbstractItemView::wheelEvent(event);
+}
+
void DolphinColumnView::zoomIn()
{
if (isZoomInPossible()) {
diff --git a/src/dolphincolumnview.h b/src/dolphincolumnview.h
index 1ebca0d67..6ac4fdb3f 100644
--- a/src/dolphincolumnview.h
+++ b/src/dolphincolumnview.h
@@ -105,6 +105,7 @@ protected:
virtual void mousePressEvent(QMouseEvent* event);
virtual void resizeEvent(QResizeEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
private slots:
void zoomIn();
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp
index 3eed9f4b3..ba5632502 100644
--- a/src/dolphincolumnwidget.cpp
+++ b/src/dolphincolumnwidget.cpp
@@ -364,6 +364,16 @@ void DolphinColumnWidget::contextMenuEvent(QContextMenuEvent* event)
}
}
+void DolphinColumnWidget::wheelEvent(QWheelEvent* event)
+{
+ // let Ctrl+wheel events propagate to the DolphinView for icon zooming
+ if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
+ event->ignore();
+ return;
+ }
+ QListView::wheelEvent(event);
+}
+
void DolphinColumnWidget::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
{
QListView::selectionChanged(selected, deselected);
diff --git a/src/dolphincolumnwidget.h b/src/dolphincolumnwidget.h
index bacbc9609..1054af2e3 100644
--- a/src/dolphincolumnwidget.h
+++ b/src/dolphincolumnwidget.h
@@ -109,6 +109,7 @@ protected:
virtual void mousePressEvent(QMouseEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void contextMenuEvent(QContextMenuEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
private slots:
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 43d74db14..df5246bed 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -364,6 +364,16 @@ void DolphinDetailsView::resizeEvent(QResizeEvent* event)
QTreeView::resizeEvent(event);
}
+void DolphinDetailsView::wheelEvent(QWheelEvent* event)
+{
+ // let Ctrl+wheel events propagate to the DolphinView for icon zooming
+ if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
+ event->ignore();
+ return;
+ }
+ QTreeView::wheelEvent(event);
+}
+
void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)
{
QHeaderView* headerView = header();
diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h
index 316620a5a..b717a0a51 100644
--- a/src/dolphindetailsview.h
+++ b/src/dolphindetailsview.h
@@ -58,6 +58,7 @@ protected:
virtual void paintEvent(QPaintEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void resizeEvent(QResizeEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
private slots:
/**
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);
}
}
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 7d3fea96a..3fec8fdfb 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -537,6 +537,20 @@ void DolphinView::mouseReleaseEvent(QMouseEvent* event)
QWidget::mouseReleaseEvent(event);
setActive(true);
}
+
+void DolphinView::wheelEvent(QWheelEvent* event)
+{
+ if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
+ int d = event->delta();
+ if (d > 0 && isZoomInPossible()) {
+ zoomIn();
+ } else if (d < 0 && isZoomOutPossible()) {
+ zoomOut();
+ }
+ event->accept();
+ }
+}
+
void DolphinView::activate()
{
setActive(true);
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 215a2a23c..f1500429b 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -512,6 +512,7 @@ signals:
protected:
/** @see QWidget::mouseReleaseEvent */
virtual void mouseReleaseEvent(QMouseEvent* event);
+ virtual void wheelEvent(QWheelEvent* event);
private slots:
/**