Skip to content

Commit 4176741

Browse files
authored
Tweak unselecting with backspace (#497)
1 parent 96dfa2f commit 4176741

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

timetagger/app/front.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,7 @@ def _handle_button_press(self, action):
16301630
elif action.startswith("select_"):
16311631
# A selection action
16321632
if action == "select_none":
1633-
self._canvas.widgets.AnalyticsWidget.selected_tags = []
1634-
self._canvas.widgets.AnalyticsWidget.update()
1633+
self._canvas.widgets.AnalyticsWidget.unselect_all_tags()
16351634

16361635

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

3703+
def unselect_all_tags(self):
3704+
self.selected_tags = []
3705+
self._tag_bars_dict = {} # trigger animation
3706+
self.update()
3707+
37043708
def on_pointer(self, ev):
37053709
x, y = ev.pos[0], ev.pos[1]
37063710

0 commit comments

Comments
 (0)