┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorShaun Reich <[email protected]>2009-01-29 23:44:20 +0000
committerShaun Reich <[email protected]>2009-01-29 23:44:20 +0000
commit6a0898178cca75c5808620d8bc1ea932a406f5fe (patch)
tree31f0168b0e3b25e48b359a19cc3a47e1d086658d /src/dolphinmainwindow.cpp
parent444310cff059e029b8271004417a5f818013e8c2 (diff)
The mouse wheel now works on Dolphin's tabs (to switch tabs), like just about every other KDE app.
svn path=/trunk/KDE/kdebase/apps/; revision=918498
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 70c287869..077005c0f 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -266,6 +266,18 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
emit selectionChanged(selection);
}
+void DolphinMainWindow::slotWheelMoved(int wheeldelta)
+{
+ if (wheeldelta > 0)
+ {
+ //Non-negative, wheel is going forwards, so the tab goes backwards (focuses left)
+ activatePrevTab();
+ } else
+ {
+ activateNextTab();
+ }
+}
+
void DolphinMainWindow::slotRequestItemInfo(const KFileItem& item)
{
emit requestItemInfo(item);
@@ -896,6 +908,9 @@ void DolphinMainWindow::init()
this, SLOT(openNewTab()));
connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)),
this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&)));
+ connect(m_tabBar, SIGNAL(wheelDelta(int)),
+ this, SLOT(slotWheelMoved(int)));
+
m_tabBar->blockSignals(true); // signals get unblocked after at least 2 tabs are open
QWidget* centralWidget = new QWidget(this);