From c0442ad5a2cc4c941328cc9687bb843bca4999bf Mon Sep 17 00:00:00 2001 From: Manan Khattar Date: Thu, 8 Apr 2021 01:14:55 -0700 Subject: [PATCH] bugfix: list of tasks reersed after sync --- timebox.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/timebox.py b/timebox.py index 003403e..b293808 100644 --- a/timebox.py +++ b/timebox.py @@ -174,17 +174,15 @@ def inner_callback(_, j=time): self.timer.start() return inner_callback - self.things_buttons = { - f"{title}": rumps.MenuItem( + self.things_buttons = {} + for idx, (title, time) in reversed(list(enumerate(self.things_processed_tasks.items()))): + menu_item = rumps.MenuItem( title=f"({time} min) {title}", callback=callback(time), key=str(idx % 10) if idx < 10 else "" ) - for idx, (title, time) in enumerate(self.things_processed_tasks.items()) - } - - for title, menu_item in self.things_buttons.items(): - self.app.menu.insert_after("hours_spent", menu_item) + self.things_buttons[title] = menu_item + self.app.menu.insert_after("hours_spent", menu_item) def run(self): self.app.menu[