Some more small optimizations
This commit is contained in:
parent
6f2e7d0e81
commit
b6e07a1c4d
10
clock.py
10
clock.py
|
@ -325,8 +325,8 @@ class MyClockWidget(FloatLayout):
|
|||
center_x = self.size[0]/2
|
||||
center_y = self.size[1]/2
|
||||
return Position(
|
||||
center_x + length * math.sin(2 * math.pi * fraction),
|
||||
center_y + length * math.cos(2 * math.pi * fraction),
|
||||
center_x + round(length * math.sin(2 * math.pi * fraction)),
|
||||
center_y + round(length * math.cos(2 * math.pi * fraction)),
|
||||
)
|
||||
|
||||
def update_set_alarm_button(self):
|
||||
|
@ -474,14 +474,12 @@ class MyClockWidget(FloatLayout):
|
|||
|
||||
def update_settings(self):
|
||||
if self.view == "settings_menu":
|
||||
self.hide_widget(self.ids["settings_menu"], False)
|
||||
self.draw_list_curr_frame.append(["self.hide_widget", self.ids["settings_menu"], False])
|
||||
elif self.view == "settings_menu_wake_up_sound":
|
||||
self.hide_widget(self.ids["settings_menu_wake_up_sound"], False)
|
||||
self.draw_list_curr_frame.append(["self.hide_widget", self.ids["settings_menu_wake_up_sound"], False])
|
||||
|
||||
def draw_display(self):
|
||||
time = datetime.datetime.now()
|
||||
if self.draw_list_curr_frame != self.draw_list_last_frame:
|
||||
|
||||
for i in self.draw_list_curr_frame:
|
||||
if i[0] == "self.hide_widget":
|
||||
self.hide_widget(i[1], i[2])
|
||||
|
|
Loading…
Reference in New Issue