mirror of
https://github.com/wassname/sloth.git
synced 2026-08-13 12:40:31 +08:00
Exit insert mode with ESC
This commit is contained in:
@@ -179,6 +179,11 @@ class ButtonArea(QWidget):
|
||||
self.show_only_label_properties("")
|
||||
self.stateChanged.emit(self.get_current_state())
|
||||
|
||||
def exitInsertMode(self):
|
||||
button = self.label_button_list.get_checked_button()
|
||||
if button is not None:
|
||||
self.label_button_list.toggleChecked(button)
|
||||
|
||||
def main():
|
||||
from conf import config
|
||||
config.update("example_config")
|
||||
|
||||
@@ -87,6 +87,13 @@ class MainWindow(QMainWindow):
|
||||
self.ui.menuPlugins.addAction(selectPreviousItem)
|
||||
self.shortcuts.append(selectPreviousItem)
|
||||
|
||||
exitInsertMode = QAction("Exit insert mode", self)
|
||||
exitInsertMode.setShortcut(QKeySequence("ESC"))
|
||||
exitInsertMode.setEnabled(True)
|
||||
exitInsertMode.triggered.connect(self.buttonarea.exitInsertMode)
|
||||
self.ui.menuPlugins.addAction(exitInsertMode)
|
||||
self.shortcuts.append(exitInsertMode)
|
||||
|
||||
###
|
||||
### GUI/Application setup
|
||||
###___________________________________________________________________________________________
|
||||
|
||||
Reference in New Issue
Block a user