modified timer so it counts to -10s
This commit is contained in:
parent
da3215ec5e
commit
c267155b25
@ -6,7 +6,7 @@ gi.require_version('Gtk', '4.0')
|
||||
from gi.repository import Gtk, Gio, Gdk
|
||||
|
||||
index = 2
|
||||
TIME = 10*60
|
||||
TIME = 10
|
||||
|
||||
class GridRow():
|
||||
def __init__(self, parent, runner, index):
|
||||
@ -41,9 +41,13 @@ class GridRow():
|
||||
|
||||
def updateTime(self):
|
||||
t = TIME
|
||||
while t:
|
||||
mins, secs = divmod(t, 60)
|
||||
timer = '{:02d}:{:02d}'.format(mins, secs)
|
||||
while t >= -10:
|
||||
if t < 0:
|
||||
mins, secs = divmod((t * -1), 60)
|
||||
timer = '-{:02d}:{:02d}'.format(mins, secs)
|
||||
else:
|
||||
mins, secs = divmod(t, 60)
|
||||
timer = '{:02d}:{:02d}'.format(mins, secs)
|
||||
self.runb.set_label(timer)
|
||||
time.sleep(1)
|
||||
t -= 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user