Skip to content

Commit a7fa75a

Browse files
author
Szelmat
committed
fix ui time bug
1 parent ab4e1d7 commit a7fa75a

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

src/info_panel.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,12 @@ def __init__(self, parent):
1010
super().__init__(parent)
1111
self.layout = wx.GridSizer(1)
1212

13-
# font = wx.Font(13, wx.FONTFAMILY_DEFAULT,
14-
# wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_LIGHT)
15-
1613
self.layout.Add(wx.StaticText(
1714
self, label="Current Activity:"), wx.ID_ANY, wx.ALIGN_CENTER)
1815

1916
self.title_label = wx.StaticText(self, label="")
20-
# self.title_label.SetFont(font)
2117
self.layout.Add(self.title_label, wx.ID_ANY, wx.ALIGN_CENTER)
2218

23-
self.timer_label = wx.StaticText(self, label="")
24-
# self.timer_label.SetFont(font)
25-
self.layout.Add(self.timer_label, wx.ID_ANY, wx.ALIGN_CENTER)
26-
2719
self.progressbar = wx.Gauge(self, size=wx.Size(400, 16))
2820
self.layout.Add(self.progressbar, wx.ID_ANY, wx.ALIGN_CENTER)
2921

src/timer_panel.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ def __init__(self, parent, name: str, seconds: int):
1414
self.build_widget()
1515
self.start_countdown()
1616

17-
def start_countdown(self):
18-
'''Construct a new countdown loop and start it'''
19-
self.reset()
20-
self.countdown_thread = threading.Thread(
21-
target=self.countdown, daemon=True)
22-
self.finished = False
23-
self.countdown_thread.start()
24-
2517
def reset(self):
2618
'''Reset the timer (used after alarm)'''
2719
self.finished = False
@@ -69,6 +61,14 @@ def calculate_time(self) -> list:
6961
hours_minutes_seconds.append(self.seconds % 60)
7062
return hours_minutes_seconds
7163

64+
def start_countdown(self):
65+
'''Construct a new countdown loop and start it'''
66+
self.reset()
67+
self.countdown_thread = threading.Thread(
68+
target=self.countdown, daemon=True)
69+
self.finished = False
70+
self.countdown_thread.start()
71+
7272
def countdown(self):
7373
'''Construct and start the countdown loop'''
7474
self.seconds = self.seconds_original

0 commit comments

Comments
 (0)