From ee1707c4d4e85f0ee05da0912c57b398c692c2a0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 16 Jul 2017 20:20:33 +0200 Subject: [PATCH] Update back/forward indicator on tab switches --- qutebrowser/mainwindow/statusbar/backforward.py | 4 ++++ qutebrowser/mainwindow/statusbar/bar.py | 1 + 2 files changed, 5 insertions(+) diff --git a/qutebrowser/mainwindow/statusbar/backforward.py b/qutebrowser/mainwindow/statusbar/backforward.py index 302de4d95..fe044e621 100644 --- a/qutebrowser/mainwindow/statusbar/backforward.py +++ b/qutebrowser/mainwindow/statusbar/backforward.py @@ -34,6 +34,10 @@ class Backforward(textbase.TextBase): self.setText('') self.hide() return + self.on_tab_changed(tab) + + def on_tab_changed(self, tab): + """Update the text based on the given tab.""" text = '' if tab.history.can_go_back(): text += '<' diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 64a084327..c6fafe14f 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -325,6 +325,7 @@ class StatusBar(QWidget): self.url.on_tab_changed(tab) self.prog.on_tab_changed(tab) self.percentage.on_tab_changed(tab) + self.backforward.on_tab_changed(tab) self.maybe_hide() assert tab.private == self._color_flags.private