diff options
| author | Yifan Zhu <[email protected]> | 2024-01-20 10:14:23 -0800 |
|---|---|---|
| committer | Yifan Zhu <[email protected]> | 2024-01-21 08:18:38 +0000 |
| commit | acc5e739ce540768c611940af936602693513f18 (patch) | |
| tree | fec97a696b62156b317cd2273613011f4c6a7de9 /src | |
| parent | 3202f8e310dba57131ea0ddfb4dfd4416b31df4b (diff) | |
dolphintabbar: only open tab on double left click
A new tab should be opened only if the double click comes from the left
button.
BUG: 480098
FIXED-IN: 24.02
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphintabbar.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp index c70089223..55b5e5edf 100644 --- a/src/dolphintabbar.cpp +++ b/src/dolphintabbar.cpp @@ -103,15 +103,17 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event) void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event) { - int index = tabAt(event->pos()); + if (event->buttons() & Qt::LeftButton) { + int index = tabAt(event->pos()); - if (index < 0) { - // empty tabbar area case - index = currentIndex(); + 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); } - // 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); } |
