connect toggle for time diff plugin

This commit is contained in:
2022-04-24 09:25:20 +02:00
parent 297f67b9b5
commit 4fbb7ac712
4 changed files with 16 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ class RAction():
def __init__(self,
label: str,
action: Callable[[], None] = None,
after_action: Callable[[], None] = None,
shortcut: str = None,
icon_from_theme: str = None,
icon_file: str = None,
@@ -28,6 +29,7 @@ class RAction():
super(RAction, self).__init__()
self.label = label
self.action = action
self.after_action = after_action
self.shortcut = shortcut
self.icon_from_theme = icon_from_theme
self.icon_file = icon_file
@@ -82,6 +84,7 @@ class RAction():
action.setShortcut(self.shortcut)
if self.action:
action.triggered.connect(self.action)
action.triggered.connect(self.after_action)
if self.checkable:
self._update_check_state()
@@ -99,6 +102,7 @@ class RAction():
button.setShortcut(self.shortcut)
if self.action:
button.pressed.connect(self.action)
button.pressed.connect(self.after_action)
if self.checkable:
button.setChecked(self.checked)
button.setCheckable(self.checkable)