Fix VerticalPosition and NewTabPosition
Make them string so they have to_py() defined.
This commit is contained in:
parent
a3d4822b9f
commit
e2b0fdf8aa
@ -252,8 +252,9 @@ class String(BaseType):
|
|||||||
completions: completions to be used, or None
|
completions: completions to be used, or None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, minlen=None, maxlen=None, forbidden=None, encoding=None,
|
def __init__(self, *, minlen=None, maxlen=None, forbidden=None,
|
||||||
none_ok=False, completions=None, valid_values=None):
|
encoding=None, none_ok=False, completions=None,
|
||||||
|
valid_values=None):
|
||||||
super().__init__(none_ok)
|
super().__init__(none_ok)
|
||||||
self.valid_values = valid_values
|
self.valid_values = valid_values
|
||||||
|
|
||||||
@ -1181,12 +1182,12 @@ class TextAlignment(MappingType):
|
|||||||
valid_values=ValidValues('left', 'right', 'center'))
|
valid_values=ValidValues('left', 'right', 'center'))
|
||||||
|
|
||||||
|
|
||||||
class VerticalPosition(BaseType):
|
class VerticalPosition(String):
|
||||||
|
|
||||||
"""The position of the download bar."""
|
"""The position of the download bar."""
|
||||||
|
|
||||||
def __init__(self, none_ok=False):
|
def __init__(self, none_ok=False):
|
||||||
super().__init__(none_ok)
|
super().__init__(none_ok=none_ok)
|
||||||
self.valid_values = ValidValues('top', 'bottom')
|
self.valid_values = ValidValues('top', 'bottom')
|
||||||
|
|
||||||
|
|
||||||
@ -1282,12 +1283,12 @@ class ConfirmQuit(FlagList):
|
|||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
class NewTabPosition(BaseType):
|
class NewTabPosition(String):
|
||||||
|
|
||||||
"""How new tabs are positioned."""
|
"""How new tabs are positioned."""
|
||||||
|
|
||||||
def __init__(self, none_ok=False):
|
def __init__(self, none_ok=False):
|
||||||
super().__init__(none_ok)
|
super().__init__(none_ok=none_ok)
|
||||||
self.valid_values = ValidValues(
|
self.valid_values = ValidValues(
|
||||||
('prev', "Before the current tab."),
|
('prev', "Before the current tab."),
|
||||||
('next', "After the current tab."),
|
('next', "After the current tab."),
|
||||||
|
@ -460,9 +460,9 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
The index of the new tab.
|
The index of the new tab.
|
||||||
"""
|
"""
|
||||||
if explicit:
|
if explicit:
|
||||||
pos = config.val.tabs.new_tab_position_explicit
|
pos = config.val.tabs.new_position_explicit
|
||||||
else:
|
else:
|
||||||
pos = config.val.tabs.new_tab_position
|
pos = config.val.tabs.new_position
|
||||||
if pos == 'prev':
|
if pos == 'prev':
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user