toggle-selection cleanup
This commit is contained in:
parent
f59a147589
commit
a728704cce
@ -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')
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user