change the code for the renamed preferences

This commit is contained in:
dkanada 2017-11-08 14:42:09 -07:00
parent 7cc3fb4a4e
commit 785bf24652
3 changed files with 21 additions and 12 deletions

View File

@ -231,7 +231,7 @@
|<<tabs.close_mouse_button_on_bar,tabs.close_mouse_button_on_bar>>|How to behave when the close mouse button is pressed on the tab bar.
|<<tabs.favicons.scale,tabs.favicons.scale>>|Scaling factor for favicons in the tab bar.
|<<tabs.favicons.show,tabs.favicons.show>>|Show favicons in the tab bar.
|<<tabs.indicator_padding,tabs.indicator_padding>>|Padding (in pixels) for tab indicators.
|<<tabs.indicator.padding,tabs.indicator.padding>>|Padding (in pixels) for tab indicators.
|<<tabs.last_close,tabs.last_close>>|How to behave when the last tab is closed.
|<<tabs.mousewheel_switching,tabs.mousewheel_switching>>|Switch between tabs using the mouse wheel.
|<<tabs.new_position.related,tabs.new_position.related>>|Position of new tabs opened from another tab.
@ -245,8 +245,8 @@
|<<tabs.title.alignment,tabs.title.alignment>>|Alignment of the text inside of tabs.
|<<tabs.title.format,tabs.title.format>>|Format to use for the tab title.
|<<tabs.title.format_pinned,tabs.title.format_pinned>>|Format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined.
|<<tabs.width.bar,tabs.width.bar>>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical.
|<<tabs.width.indicator,tabs.width.indicator>>|Width (in pixels) of the progress indicator (0 to disable).
|<<tabs.width,tabs.width>>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical.
|<<tabs.indicator.width,tabs.indicator.width>>|Width (in pixels) of the progress indicator (0 to disable).
|<<tabs.wrap,tabs.wrap>>|Wrap when changing tabs.
|<<url.auto_search,url.auto_search>>|What search to start when something else than a URL is entered.
|<<url.default_page,url.default_page>>|Page to open if :open -t/-b/-w is used without URL.

View File

@ -1197,13 +1197,16 @@ tabs.favicons.show:
desc: Show favicons in the tab bar.
tabs.indicator_padding:
renamed: tabs.indicator.padding
tabs.indicator.padding:
default:
top: 2
bottom: 2
left: 0
right: 4
type: Padding
desc: Padding (in pixels) for tab indicators.
desc: Padding for tab indicators
tabs.last_close:
default: ignore
@ -1330,6 +1333,9 @@ tabs.title.format_pinned:
like for `tabs.title.format` are defined.
tabs.width.bar:
renamed: tabs.width
tabs.width:
default: 20%
type:
name: PercOrInt
@ -1340,11 +1346,14 @@ tabs.width.bar:
it's vertical."
tabs.width.indicator:
renamed: tabs.indicator.width
tabs.indicator.width:
default: 3
type:
name: Int
minval: 0
desc: Width (in pixels) of the progress indicator (0 to disable).
desc: Width of the progress indicator (0 to disable).
tabs.width.pinned:
deleted: true

View File

@ -353,9 +353,9 @@ class TabBar(QTabBar):
self.update()
# Clear _minimum_tab_size_hint_helper cache when appropriate
if option in ["tabs.indicator_padding",
if option in ["tabs.indicator.padding",
"tabs.padding",
"tabs.width.indicator"]:
"tabs.indicator.width"]:
self._minimum_tab_size_hint_helper.cache_clear()
def _on_show_switching_delay_changed(self):
@ -508,8 +508,8 @@ class TabBar(QTabBar):
text_width = min(_text_to_width(text),
_text_to_width(tab_text))
padding = config.val.tabs.padding
indicator_width = config.val.tabs.width.indicator
indicator_padding = config.val.tabs.indicator_padding
indicator_width = config.val.tabs.indicator.width
indicator_padding = config.val.tabs.indicator.padding
padding_h = padding.left + padding.right
# Only add padding if indicator exists
if indicator_width != 0:
@ -550,7 +550,7 @@ class TabBar(QTabBar):
minimum_size = self.minimumTabSizeHint(index)
height = minimum_size.height()
if self.vertical:
confwidth = str(config.val.tabs.width.bar)
confwidth = str(config.val.tabs.width)
if confwidth.endswith('%'):
main_window = objreg.get('main-window', scope='window',
window=self._win_id)
@ -826,7 +826,7 @@ class TabBarStyle(QCommonStyle):
A Layout object with two QRects.
"""
padding = config.val.tabs.padding
indicator_padding = config.val.tabs.indicator_padding
indicator_padding = config.val.tabs.indicator.padding
text_rect = QRect(opt.rect)
if not text_rect.isValid():
@ -837,7 +837,7 @@ class TabBarStyle(QCommonStyle):
text_rect.adjust(padding.left, padding.top, -padding.right,
-padding.bottom)
indicator_width = config.val.tabs.width.indicator
indicator_width = config.val.tabs.indicator.width
if indicator_width == 0:
indicator_rect = QRect()
else: