Some more small optimizations

This commit is contained in:
Admar Schoonen 2023-02-17 21:43:24 +01:00
parent 6f2e7d0e81
commit b6e07a1c4d
1 changed files with 4 additions and 6 deletions

View File

@ -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])