X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ed2d352c42a6d517d4f29b3582c0e00aa34fe647..7a28bed8ee3c6400abc2cfe8bd1ce67454f4d00a:/src/dolphintabbar.cpp diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp index a7799a669..55b5e5edf 100644 --- a/src/dolphintabbar.cpp +++ b/src/dolphintabbar.cpp @@ -32,7 +32,7 @@ DolphinTabBar::DolphinTabBar(QWidget *parent) void DolphinTabBar::dragEnterEvent(QDragEnterEvent *event) { const QMimeData *mimeData = event->mimeData(); - const int index = tabAt(event->pos()); + const int index = tabAt(event->position().toPoint()); if (mimeData->hasUrls()) { event->acceptProposedAction(); @@ -52,7 +52,7 @@ void DolphinTabBar::dragLeaveEvent(QDragLeaveEvent *event) void DolphinTabBar::dragMoveEvent(QDragMoveEvent *event) { const QMimeData *mimeData = event->mimeData(); - const int index = tabAt(event->pos()); + const int index = tabAt(event->position().toPoint()); if (mimeData->hasUrls()) { updateAutoActivationTimer(index); @@ -67,7 +67,7 @@ void DolphinTabBar::dropEvent(QDropEvent *event) updateAutoActivationTimer(-1); const QMimeData *mimeData = event->mimeData(); - const int index = tabAt(event->pos()); + const int index = tabAt(event->position().toPoint()); if (mimeData->hasUrls()) { Q_EMIT tabDropEvent(index, event); @@ -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); }