Skip to content

Commit 96dfa2f

Browse files
Backspace can unselect all tags now (#484)
* Backspace can now unselect all tags * Added the info about the new backspace shortcut into the GUI * Update timetagger/app/front.py --------- Co-authored-by: Almar Klein <[email protected]>
1 parent 332a51d commit 96dfa2f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

timetagger/app/dialogs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,7 @@ def open(self, callback=None):
38493849
"T": "Select time range",
38503850
"R": "Open report dialog",
38513851
"I": "Open the guide",
3852+
"Backspace": "Unselect all tags",
38523853
}
38533854
shortcuts_html = ""
38543855
for key, expl in shortcuts.items():

timetagger/app/front.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,8 @@ def _on_key(self, e):
14621462
#
14631463
elif e.key.lower() == "f":
14641464
self._handle_button_press("search")
1465+
elif e.key.lower() == "backspace":
1466+
self._handle_button_press("select_none")
14651467
#
14661468
elif e.key.lower() == "arrowup" or e.key.lower() == "pageup":
14671469
self._handle_button_press("nav_backward")
@@ -1625,6 +1627,12 @@ def _handle_button_press(self, action):
16251627
elif action == "nav_menu":
16261628
self._canvas.timeselection_dialog.open()
16271629

1630+
elif action.startswith("select_"):
1631+
# A selection action
1632+
if action == "select_none":
1633+
self._canvas.widgets.AnalyticsWidget.selected_tags = []
1634+
self._canvas.widgets.AnalyticsWidget.update()
1635+
16281636

16291637
class RecordsWidget(Widget):
16301638
"""Widget that draws the records, ticks, handles record

0 commit comments

Comments
 (0)