diff options
-rw-r--r-- | src/tabwindow/tabbar.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tabwindow/tabbar.cpp b/src/tabwindow/tabbar.cpp index 7363d965..1ca3d4c2 100644 --- a/src/tabwindow/tabbar.cpp +++ b/src/tabwindow/tabbar.cpp @@ -579,10 +579,7 @@ void TabBar::unpinTab() return; int index = a->data().toInt(); - - // set the tab data false to forget this pinned tab - setTabData(index, false); - + // Find the available index to move int availableIndex = 0; for (int i = 1; i < count(); i++) @@ -592,8 +589,9 @@ void TabBar::unpinTab() availableIndex = i - 1; break; } + availableIndex++; } - + TabWidget *w = qobject_cast<TabWidget *>(parent()); w->moveTab(index, availableIndex); index = availableIndex; @@ -601,6 +599,9 @@ void TabBar::unpinTab() tabButton(index, QTabBar::RightSide)->show(); setTabText(index, w->webWindow(index)->title()); + // set the tab data false to forget this pinned tab + setTabData(index, false); + // workaround: "fix" the icon (or at least, try to...) QLabel *label = qobject_cast<QLabel* >(tabButton(index, QTabBar::LeftSide)); if (!label) |