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