]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Tabbar: duplicate tab when double clicking on it
authorMéven Car <meven@kde.org>
Mon, 29 May 2023 07:56:50 +0000 (09:56 +0200)
committerMéven Car <meven.car@kdemail.net>
Tue, 13 Jun 2023 09:48:55 +0000 (09:48 +0000)
BUG: 470388

src/dolphintabbar.cpp

index 82695ac21a32f16ce372f95bf63a8bea6b421959..c04b349546fff16329be88eef8c97c56d93e084a 100644 (file)
@@ -103,14 +103,15 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
 
 void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event)
 {
-    const int index = tabAt(event->pos());
+    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;
+        // empty tabbar area case
+        index = currentIndex();
     }
+    // Double 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);
 }