Add setting for controlling stacking of new tabs
This commit is contained in:
parent
3399f2df96
commit
1919029858
@ -1348,12 +1348,27 @@ tabs.mousewheel_switching:
|
|||||||
tabs.new_position.related:
|
tabs.new_position.related:
|
||||||
default: next
|
default: next
|
||||||
type: NewTabPosition
|
type: NewTabPosition
|
||||||
desc: Position of new tabs opened from another tab.
|
desc: >-
|
||||||
|
Position of new tabs opened from another tab.
|
||||||
|
|
||||||
|
See `tabs.new_position.stacking` for controlling stacking behavior.
|
||||||
|
|
||||||
tabs.new_position.unrelated:
|
tabs.new_position.unrelated:
|
||||||
default: last
|
default: last
|
||||||
type: NewTabPosition
|
type: NewTabPosition
|
||||||
desc: "Position of new tabs which aren't opened from another tab."
|
desc: >-
|
||||||
|
Position of new tabs which are not opened from another tab.
|
||||||
|
|
||||||
|
See `tabs.new_position.stacking` for controlling stacking behavior.
|
||||||
|
|
||||||
|
tabs.new_position.stacking:
|
||||||
|
default: true
|
||||||
|
type: Bool
|
||||||
|
desc: >-
|
||||||
|
Stack relative tabs on top of each other when opened consecutively.
|
||||||
|
|
||||||
|
Only applies `next` and `prev` values of `tabs.new_position.related` and
|
||||||
|
`tabs.new_position.unrelated`.
|
||||||
|
|
||||||
tabs.padding:
|
tabs.padding:
|
||||||
default:
|
default:
|
||||||
|
@ -533,7 +533,10 @@ class TabbedBrowser(QWidget):
|
|||||||
# *before* the currently focused tab, indices will shift by
|
# *before* the currently focused tab, indices will shift by
|
||||||
# 1 automatically.
|
# 1 automatically.
|
||||||
elif pos == 'next':
|
elif pos == 'next':
|
||||||
idx = self._tab_insert_idx_right
|
if config.val.tabs.new_position.stacking:
|
||||||
|
idx = self._tab_insert_idx_right
|
||||||
|
else:
|
||||||
|
idx = self.widget.currentIndex() + 1
|
||||||
self._tab_insert_idx_right += 1
|
self._tab_insert_idx_right += 1
|
||||||
elif pos == 'first':
|
elif pos == 'first':
|
||||||
idx = 0
|
idx = 0
|
||||||
|
@ -894,6 +894,39 @@ Feature: Tab management
|
|||||||
- about:blank
|
- about:blank
|
||||||
- data/hello.txt (active)
|
- data/hello.txt (active)
|
||||||
|
|
||||||
|
# stacking tabs
|
||||||
|
Scenario: 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 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/index.html (active)
|
||||||
|
- data/navigate/prev.html
|
||||||
|
- data/navigate/next.html
|
||||||
|
|
||||||
|
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
|
||||||
|
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/index.html (active)
|
||||||
|
- data/navigate/next.html
|
||||||
|
- data/navigate/prev.html
|
||||||
|
|
||||||
# :buffer
|
# :buffer
|
||||||
|
|
||||||
Scenario: :buffer without args or count
|
Scenario: :buffer without args or count
|
||||||
|
Loading…
Reference in New Issue
Block a user