]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphintabbar.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / dolphintabbar.cpp
index aa74e17ae6dea5949d4ce0d5edf678301e3cbd2d..55b5e5edfd03c703dbdc05647db7973d6afba5e2 100644 (file)
@@ -103,13 +103,16 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
 
 void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event)
 {
-    const int index = tabAt(event->pos());
+    if (event->buttons() & Qt::LeftButton) {
+        int index = tabAt(event->pos());
 
-    if (index < 0) {
-        // Double click on the empty tabbar area opens a new activated tab
-        // with the url from the current tab.
-        Q_EMIT openNewActivatedTab(currentIndex());
-        return;
+        if (index < 0) {
+            // empty tabbar area case
+            index = currentIndex();
+        }
+        // Double left click on the tabbar opens a new activated tab
+        // with the url from the doubleclicked tab or currentTab otherwise.
+        Q_EMIT openNewActivatedTab(index);
     }
 
     QTabBar::mouseDoubleClickEvent(event);
@@ -171,3 +174,5 @@ void DolphinTabBar::updateAutoActivationTimer(const int index)
         }
     }
 }
+
+#include "moc_dolphintabbar.cpp"