From 785bf246528c9a5d2c39a63ccdbb62a64ecc4678 Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 8 Nov 2017 14:42:09 -0700 Subject: [PATCH 1/4] change the code for the renamed preferences --- doc/help/settings.asciidoc | 6 +++--- qutebrowser/config/configdata.yml | 13 +++++++++++-- qutebrowser/mainwindow/tabwidget.py | 14 +++++++------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 13ff2156b..163b879f0 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -231,7 +231,7 @@ |<>|How to behave when the close mouse button is pressed on the tab bar. |<>|Scaling factor for favicons in the tab bar. |<>|Show favicons in the tab bar. -|<>|Padding (in pixels) for tab indicators. +|<>|Padding (in pixels) for tab indicators. |<>|How to behave when the last tab is closed. |<>|Switch between tabs using the mouse wheel. |<>|Position of new tabs opened from another tab. @@ -245,8 +245,8 @@ |<>|Alignment of the text inside of tabs. |<>|Format to use for the tab title. |<>|Format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined. -|<>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical. -|<>|Width (in pixels) of the progress indicator (0 to disable). +|<>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical. +|<>|Width (in pixels) of the progress indicator (0 to disable). |<>|Wrap when changing tabs. |<>|What search to start when something else than a URL is entered. |<>|Page to open if :open -t/-b/-w is used without URL. diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 1a9af49f6..64f8633cb 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -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 diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 4da38092e..e80327238 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -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: From b8b49637e26eef8987250762eb76647a268c65d0 Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 8 Nov 2017 14:46:00 -0700 Subject: [PATCH 2/4] replace changes to desc --- qutebrowser/config/configdata.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 64f8633cb..4e64a873d 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1206,7 +1206,7 @@ tabs.indicator.padding: left: 0 right: 4 type: Padding - desc: Padding for tab indicators + desc: Padding (in pixels) for tab indicators. tabs.last_close: default: ignore @@ -1353,7 +1353,7 @@ tabs.indicator.width: type: name: Int minval: 0 - desc: Width of the progress indicator (0 to disable). + desc: Width (in pixels) of the progress indicator (0 to disable). tabs.width.pinned: deleted: true From 6ecd429d8f0f8b04b37f81f807855ede55427520 Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 8 Nov 2017 15:27:16 -0700 Subject: [PATCH 3/4] group indicator preferences --- qutebrowser/config/configdata.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 4e64a873d..e8581563b 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1196,18 +1196,6 @@ tabs.favicons.show: type: Bool 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. - tabs.last_close: default: ignore type: @@ -1355,6 +1343,18 @@ tabs.indicator.width: minval: 0 desc: Width (in pixels) of the progress indicator (0 to disable). +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. + tabs.width.pinned: deleted: true From 2f7a705015b70a29d23a9f8062c8c8f6ad295fff Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 8 Nov 2017 15:29:35 -0700 Subject: [PATCH 4/4] forgot to update the settings page --- doc/help/settings.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 163b879f0..654c6f796 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -231,7 +231,6 @@ |<>|How to behave when the close mouse button is pressed on the tab bar. |<>|Scaling factor for favicons in the tab bar. |<>|Show favicons in the tab bar. -|<>|Padding (in pixels) for tab indicators. |<>|How to behave when the last tab is closed. |<>|Switch between tabs using the mouse wheel. |<>|Position of new tabs opened from another tab. @@ -247,6 +246,7 @@ |<>|Format to use for the tab title for pinned tabs. The same placeholders like for `tabs.title.format` are defined. |<>|Width (in pixels or as percentage of the window) of the tab bar if it's vertical. |<>|Width (in pixels) of the progress indicator (0 to disable). +|<>|Padding (in pixels) for tab indicators. |<>|Wrap when changing tabs. |<>|What search to start when something else than a URL is entered. |<>|Page to open if :open -t/-b/-w is used without URL.