From aa7c56280a7209d1c7fe272aba065c6f72df775c Mon Sep 17 00:00:00 2001 From: ahpakar Date: Wed, 27 Aug 2025 21:16:29 +0300 Subject: [PATCH 1/5] statusbar: mode_text config option --- qutebrowser/config/configdata.yml | 5 +++++ qutebrowser/mainwindow/statusbar/bar.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index dbe9e124f..d635e0d4a 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2195,6 +2195,11 @@ statusbar.widgets: default: ['keypress', 'search_match', 'url', 'scroll', 'history', 'tabs', 'progress'] desc: "List of widgets displayed in the statusbar." +statusbar.mode_text: + default: true + type: Bool + desc: Show a text widget with the current input mode in the statusbar + ## tabs tabs.background: diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index b628a03cc..5f5dd53c0 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -174,6 +174,8 @@ class StatusBar(QWidget): self.txt = textbase.TextBase() self._stack.addWidget(self.txt) + if not config.val.statusbar.mode_text: + self.txt.hide() self.cmd.show_cmd.connect(self._show_cmd_widget) self.cmd.hide_cmd.connect(self._hide_cmd_widget) @@ -232,6 +234,11 @@ class StatusBar(QWidget): self._set_hbox_padding() elif option == 'statusbar.widgets': self._draw_widgets() + elif option == 'statusbar.mode_text': + if not config.val.statusbar.mode_text: + self.txt.hide() + else: + self.txt.show() def _draw_widgets(self): """Draw statusbar widgets.""" From ba9ea20c10b31fd016091009d980e6d8a7fa00fd Mon Sep 17 00:00:00 2001 From: ahpakar Date: Wed, 27 Aug 2025 21:24:38 +0300 Subject: [PATCH 2/5] run src2asciidoc.py --- doc/help/settings.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index d25a71cb6..8d543594e 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -314,6 +314,7 @@ |<>|Name of the session to save by default. |<>|Load a restored tab as soon as it takes focus. |<>|Languages to use for spell checking. +|<>|Show a text widget with the current input mode in the statusbar |<>|Padding (in pixels) for the statusbar. |<>|Position of the status bar. |<>|When to show the statusbar. @@ -4170,6 +4171,14 @@ Valid values: Default: empty +[[statusbar.mode_text]] +=== statusbar.mode_text +Show a text widget with the current input mode in the statusbar + +Type: <> + +Default: +pass:[true]+ + [[statusbar.padding]] === statusbar.padding Padding (in pixels) for the statusbar. From ccf230c169fe4d5871842d7930256d3e6897feea Mon Sep 17 00:00:00 2001 From: ahpakar Date: Wed, 27 Aug 2025 21:30:48 +0300 Subject: [PATCH 3/5] full stop for consistency + (rebase forced update) --- doc/help/settings.asciidoc | 4 ++-- qutebrowser/config/configdata.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 8d543594e..48e1abf6f 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -314,7 +314,7 @@ |<>|Name of the session to save by default. |<>|Load a restored tab as soon as it takes focus. |<>|Languages to use for spell checking. -|<>|Show a text widget with the current input mode in the statusbar +|<>|Show a text widget with the current input mode in the statusbar. |<>|Padding (in pixels) for the statusbar. |<>|Position of the status bar. |<>|When to show the statusbar. @@ -4173,7 +4173,7 @@ Default: empty [[statusbar.mode_text]] === statusbar.mode_text -Show a text widget with the current input mode in the statusbar +Show a text widget with the current input mode in the statusbar. Type: <> diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index d635e0d4a..b68892294 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -2198,7 +2198,7 @@ statusbar.widgets: statusbar.mode_text: default: true type: Bool - desc: Show a text widget with the current input mode in the statusbar + desc: Show a text widget with the current input mode in the statusbar. ## tabs From a7ef2259c9ffb7df72b30b5c18ec2a2eb2734d29 Mon Sep 17 00:00:00 2001 From: ahpakar Date: Thu, 28 Aug 2025 10:36:00 +0300 Subject: [PATCH 4/5] use empty string instead --- qutebrowser/mainwindow/statusbar/bar.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 5f5dd53c0..54a217505 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -174,8 +174,6 @@ class StatusBar(QWidget): self.txt = textbase.TextBase() self._stack.addWidget(self.txt) - if not config.val.statusbar.mode_text: - self.txt.hide() self.cmd.show_cmd.connect(self._show_cmd_widget) self.cmd.hide_cmd.connect(self._hide_cmd_widget) @@ -234,11 +232,6 @@ class StatusBar(QWidget): self._set_hbox_padding() elif option == 'statusbar.widgets': self._draw_widgets() - elif option == 'statusbar.mode_text': - if not config.val.statusbar.mode_text: - self.txt.hide() - else: - self.txt.show() def _draw_widgets(self): """Draw statusbar widgets.""" @@ -351,6 +344,9 @@ class StatusBar(QWidget): def _set_mode_text(self, mode): """Set the mode text.""" + if not config.val.statusbar.mode_text: + self.txt.setText('') + return; if mode == 'passthrough': key_instance = config.key_instance all_bindings = key_instance.get_reverse_bindings_for('passthrough') From 5af3e8ea57d5d3a7d3c6904b58de8999e26d8a9f Mon Sep 17 00:00:00 2001 From: ahpakar Date: Thu, 28 Aug 2025 10:37:44 +0300 Subject: [PATCH 5/5] no semicolon --- qutebrowser/mainwindow/statusbar/bar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 54a217505..3aa518934 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -346,7 +346,7 @@ class StatusBar(QWidget): """Set the mode text.""" if not config.val.statusbar.mode_text: self.txt.setText('') - return; + return if mode == 'passthrough': key_instance = config.key_instance all_bindings = key_instance.get_reverse_bindings_for('passthrough')