Fix behavior when toggling stacking behavior in a single tab

This commit is contained in:
Jay Kamat 2018-06-21 18:58:48 -04:00
parent 0e7bbccd71
commit 454c532668
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 4 additions and 4 deletions

View File

@ -1365,7 +1365,7 @@ tabs.new_position.stacking:
default: true default: true
type: Bool type: Bool
desc: >- desc: >-
Stack relative tabs on top of each other when opened consecutively. Stack related tabs on top of each other when opened consecutively.
Only applies `next` and `prev` values of `tabs.new_position.related` and Only applies `next` and `prev` values of `tabs.new_position.related` and
`tabs.new_position.unrelated`. `tabs.new_position.unrelated`.

View File

@ -530,17 +530,17 @@ class TabbedBrowser(QWidget):
idx = self._tab_insert_idx_left idx = self._tab_insert_idx_left
# On first sight, we'd think we have to decrement # On first sight, we'd think we have to decrement
# self._tab_insert_idx_left here, as we want the next tab to be # self._tab_insert_idx_left here, as we want the next tab to be
# *before* the one we just opened. However, since we opened a tab # *before* the one we just opened. However, since we opened a
# *before* the currently focused tab, indices will shift by # tab *before* the currently focused tab, indices will shift by
# 1 automatically. # 1 automatically.
else: else:
idx = self.widget.currentIndex() idx = self.widget.currentIndex()
elif pos == 'next': elif pos == 'next':
if config.val.tabs.new_position.stacking: if config.val.tabs.new_position.stacking:
idx = self._tab_insert_idx_right idx = self._tab_insert_idx_right
self._tab_insert_idx_right += 1
else: else:
idx = self.widget.currentIndex() + 1 idx = self.widget.currentIndex() + 1
self._tab_insert_idx_right += 1
elif pos == 'first': elif pos == 'first':
idx = 0 idx = 0
elif pos == 'last': elif pos == 'last':