From 3f6c41423067bb9c8824004df2a3cb9586ebd7d1 Mon Sep 17 00:00:00 2001 From: pylbrecht Date: Sat, 13 Jul 2024 16:36:35 +0200 Subject: [PATCH] Integrate StatusBarItem interface in _draw_widgets() --- qutebrowser/mainwindow/statusbar/bar.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 21a35203af9..7c53eb72349 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -253,16 +253,10 @@ def _draw_widgets(self): self._hbox.addWidget(widget.widget) - if segment in ('history', 'progress'): - widget.widget.enabled = True - if tab: - widget.widget.on_tab_changed(tab) + if isinstance(widget, (backforward.Backforward, progress.Progress)) and tab: + widget.widget.on_tab_changed(tab) - # Do not call .show() for these widgets. They are not always shown, and - # dynamically show/hide themselves in their on_tab_changed() methods. - continue - - widget.show() + widget.enable() def _clear_widgets(self): """Clear widgets before redrawing them."""