mirror of
https://invent.kde.org/network/falkon.git
synced 2024-09-21 17:52:10 +02:00
parent
eb90925a32
commit
b07d9cc976
|
@ -642,7 +642,7 @@ void TabBar::dragMoveEvent(QDragMoveEvent *event)
|
||||||
const int index = tabAt(event->pos());
|
const int index = tabAt(event->pos());
|
||||||
const QMimeData* mime = event->mimeData();
|
const QMimeData* mime = event->mimeData();
|
||||||
|
|
||||||
if (index == -1 || (mime->hasFormat(MIMETYPE) && event->source() == this)) {
|
if (index == -1) {
|
||||||
ComboTabBar::dragMoveEvent(event);
|
ComboTabBar::dragMoveEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -680,10 +680,6 @@ void TabBar::dropEvent(QDropEvent* event)
|
||||||
|
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
|
|
||||||
if (mime->hasFormat(MIMETYPE) && event->source() == this) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TabBar *sourceTabBar = qobject_cast<TabBar*>(event->source());
|
TabBar *sourceTabBar = qobject_cast<TabBar*>(event->source());
|
||||||
|
|
||||||
int index = tabAt(event->pos());
|
int index = tabAt(event->pos());
|
||||||
|
@ -722,9 +718,13 @@ void TabBar::dropEvent(QDropEvent* event)
|
||||||
} else if (mime->hasFormat(MIMETYPE) && sourceTabBar) {
|
} else if (mime->hasFormat(MIMETYPE) && sourceTabBar) {
|
||||||
WebTab *tab = sourceTabBar->webTab();
|
WebTab *tab = sourceTabBar->webTab();
|
||||||
if (tab) {
|
if (tab) {
|
||||||
sourceTabBar->m_tabWidget->detachTab(tab);
|
if (sourceTabBar == this) {
|
||||||
tab->setPinned(index < pinnedTabsCount());
|
tab->moveTab(newIndex > tab->tabIndex() ? newIndex - 1 : newIndex);
|
||||||
m_tabWidget->insertView(newIndex, tab, Qz::NT_SelectedTab);
|
} else {
|
||||||
|
sourceTabBar->m_tabWidget->detachTab(tab);
|
||||||
|
tab->setPinned(index < pinnedTabsCount());
|
||||||
|
m_tabWidget->insertView(newIndex, tab, Qz::NT_SelectedTab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user