Fix stacking tabs setting with new_tab prev
This commit is contained in:
parent
1919029858
commit
0e7bbccd71
@ -526,18 +526,21 @@ class TabbedBrowser(QWidget):
|
||||
else:
|
||||
pos = config.val.tabs.new_position.unrelated
|
||||
if pos == 'prev':
|
||||
idx = self._tab_insert_idx_left
|
||||
# On first sight, we'd think we have to decrement
|
||||
# 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 currently focused tab, indices will shift by
|
||||
# 1 automatically.
|
||||
if config.val.tabs.new_position.stacking:
|
||||
idx = self._tab_insert_idx_left
|
||||
# On first sight, we'd think we have to decrement
|
||||
# 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 currently focused tab, indices will shift by
|
||||
# 1 automatically.
|
||||
else:
|
||||
idx = self.widget.currentIndex()
|
||||
elif pos == 'next':
|
||||
if config.val.tabs.new_position.stacking:
|
||||
idx = self._tab_insert_idx_right
|
||||
self._tab_insert_idx_right += 1
|
||||
else:
|
||||
idx = self.widget.currentIndex() + 1
|
||||
self._tab_insert_idx_right += 1
|
||||
elif pos == 'first':
|
||||
idx = 0
|
||||
elif pos == 'last':
|
||||
|
@ -911,6 +911,22 @@ Feature: Tab management
|
||||
- data/navigate/prev.html
|
||||
- data/navigate/next.html
|
||||
|
||||
Scenario: stacking tabs opening tab with tabs.new_position.related prev
|
||||
When I set tabs.new_position.related to prev
|
||||
And I set tabs.new_position.stacking to true
|
||||
And I set tabs.background to true
|
||||
And I open about:blank
|
||||
And I open data/navigate/index.html in a new tab
|
||||
And I hint with args "all tab-bg" and follow a
|
||||
And I hint with args "all tab-bg" and follow s
|
||||
And I wait until data/navigate/prev.html is loaded
|
||||
And I wait until data/navigate/next.html is loaded
|
||||
Then the following tabs should be open:
|
||||
- about:blank
|
||||
- data/navigate/next.html
|
||||
- data/navigate/prev.html
|
||||
- data/navigate/index.html (active)
|
||||
|
||||
Scenario: no stacking tabs opening tab with tabs.new_position.related next
|
||||
When I set tabs.new_position.related to next
|
||||
And I set tabs.new_position.stacking to false
|
||||
@ -927,6 +943,22 @@ Feature: Tab management
|
||||
- data/navigate/next.html
|
||||
- data/navigate/prev.html
|
||||
|
||||
Scenario: no stacking tabs opening tab with tabs.new_position.related prev
|
||||
When I set tabs.new_position.related to prev
|
||||
And I set tabs.new_position.stacking to false
|
||||
And I set tabs.background to true
|
||||
And I open about:blank
|
||||
And I open data/navigate/index.html in a new tab
|
||||
And I hint with args "all tab-bg" and follow a
|
||||
And I hint with args "all tab-bg" and follow s
|
||||
And I wait until data/navigate/prev.html is loaded
|
||||
And I wait until data/navigate/next.html is loaded
|
||||
Then the following tabs should be open:
|
||||
- about:blank
|
||||
- data/navigate/prev.html
|
||||
- data/navigate/next.html
|
||||
- data/navigate/index.html (active)
|
||||
|
||||
# :buffer
|
||||
|
||||
Scenario: :buffer without args or count
|
||||
|
Loading…
Reference in New Issue
Block a user