Skip to content

Commit

Permalink
Tweak unselecting with backspace
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Jul 24, 2024
1 parent 96dfa2f commit 161c231
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions timetagger/app/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -1630,8 +1630,7 @@ def _handle_button_press(self, action):
elif action.startswith("select_"):
# A selection action
if action == "select_none":
self._canvas.widgets.AnalyticsWidget.selected_tags = []
self._canvas.widgets.AnalyticsWidget.update()
self._canvas.widgets.AnalyticsWidget.unselect_all_tags()


class RecordsWidget(Widget):
Expand Down Expand Up @@ -3701,6 +3700,11 @@ def _draw_one_bar(self, ctx, bar):
ctx, tx, ty, None, but_height, tag, "select:" + tag, tt, opt
)

def unselect_all_tags(self):
self.selected_tags = []
self._tag_bars_dict = {} # trigger animation
self.update()

def on_pointer(self, ev):
x, y = ev.pos[0], ev.pos[1]

Expand Down

0 comments on commit 161c231

Please sign in to comment.