X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/38c34eeca315c7be58e65d4d3fb72aaf7b866719..9ed236d88ded945c683cf76be92e6032172975d0:/src/dolphintabbar.cpp diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp index 82695ac21..c70089223 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,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); } @@ -171,3 +172,5 @@ void DolphinTabBar::updateAutoActivationTimer(const int index) } } } + +#include "moc_dolphintabbar.cpp"