Changed behavior on location of tab being pinned

Now when a tab is pinned it goes to the end of all pinned tabs.
Before it went to the index 1.
This commit is contained in:
thuck 2016-11-11 12:05:04 +01:00
parent 00f2b4df96
commit 19cc721eb1

View File

@ -271,6 +271,7 @@ class CommandDispatcher:
index: Location where the tab should be pinned/unpinned. index: Location where the tab should be pinned/unpinned.
count: The tab index to pin or unpin, or None count: The tab index to pin or unpin, or None
""" """
tabbar = self._tabbed_browser.tabBar()
tab = self._cntwidget(count) tab = self._cntwidget(count)
if tab is None: if tab is None:
return return
@ -278,7 +279,7 @@ class CommandDispatcher:
tab.data.pinned = not tab.data.pinned tab.data.pinned = not tab.data.pinned
if tab.data.pinned: if tab.data.pinned:
index = 1 if index is None else int(index) index = tabbar.pinned + 1 if index is None else int(index)
else: else:
index = self._count() if index is None else int(index) index = self._count() if index is None else int(index)