From a728704cce335ee352707ba220c8c8fdc2902356 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 13 May 2015 21:52:42 +0200 Subject: [PATCH] toggle-selection cleanup --- qutebrowser/browser/commands.py | 2 +- qutebrowser/mainwindow/statusbar/bar.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3b71fc4f4..4679eb9b8 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1423,7 +1423,7 @@ class CommandDispatcher: widget.selection_enabled = not widget.selection_enabled mainwindow = objreg.get('main-window', scope='window', window=self._win_id) - mainwindow.status.on_mode_entered(usertypes.KeyMode.caret) + mainwindow.status.set_mode_active(usertypes.KeyMode.caret, True) @cmdutils.register(instance='command-dispatcher', hide=True, modes=[KeyMode.caret], scope='window') diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 503cc38c1..6df62e258 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -273,7 +273,7 @@ class StatusBar(QWidget): """Getter for caret_selection_active, so it can be used as property.""" return self._caret_selection_active - def _set_mode_active(self, mode, val): + def set_mode_active(self, mode, val): """Setter for self.{insert,caret}_active. Re-set the stylesheet after setting the value, so everything gets @@ -474,7 +474,7 @@ class StatusBar(QWidget): if mode in mode_manager.passthrough: self._set_mode_text(mode.name) if mode in (usertypes.KeyMode.insert, usertypes.KeyMode.caret): - self._set_mode_active(mode, True) + self.set_mode_active(mode, True) @pyqtSlot(usertypes.KeyMode, usertypes.KeyMode) def on_mode_left(self, old_mode, new_mode): @@ -487,7 +487,7 @@ class StatusBar(QWidget): else: self.txt.set_text(self.txt.Text.normal, '') if old_mode in (usertypes.KeyMode.insert, usertypes.KeyMode.caret): - self._set_mode_active(old_mode, False) + self.set_mode_active(old_mode, False) @config.change_filter('ui', 'message-timeout') def set_pop_timer_interval(self):