Skip to content

Commit

Permalink
Backspace can unselect all tags now (#484)
Browse files Browse the repository at this point in the history
* 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 <almar@almarklein.org>
  • Loading branch information
Tagirijus and almarklein committed Jul 18, 2024
1 parent 332a51d commit 96dfa2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions timetagger/app/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3849,6 +3849,7 @@ def open(self, callback=None):
"T": "Select time range",
"R": "Open report dialog",
"I": "Open the guide",
"Backspace": "Unselect all tags",
}
shortcuts_html = ""
for key, expl in shortcuts.items():
Expand Down
8 changes: 8 additions & 0 deletions timetagger/app/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,8 @@ def _on_key(self, e):
#
elif e.key.lower() == "f":
self._handle_button_press("search")
elif e.key.lower() == "backspace":
self._handle_button_press("select_none")
#
elif e.key.lower() == "arrowup" or e.key.lower() == "pageup":
self._handle_button_press("nav_backward")
Expand Down Expand Up @@ -1625,6 +1627,12 @@ def _handle_button_press(self, action):
elif action == "nav_menu":
self._canvas.timeselection_dialog.open()

elif action.startswith("select_"):
# A selection action
if action == "select_none":
self._canvas.widgets.AnalyticsWidget.selected_tags = []
self._canvas.widgets.AnalyticsWidget.update()


class RecordsWidget(Widget):
"""Widget that draws the records, ticks, handles record
Expand Down

0 comments on commit 96dfa2f

Please sign in to comment.