Small bugfixes

This commit is contained in:
Admar Schoonen 2023-08-01 12:10:09 +02:00
parent fd568adcd9
commit 5a2fcb10db
1 changed files with 8 additions and 6 deletions

View File

@ -40,7 +40,7 @@ if is_arm():
import board
import neopixel
pixel_pin = board.D10
num_pixels = 144
num_pixels = 300
ORDER = neopixel.GRBW
pixels = neopixel.NeoPixel(
@ -686,7 +686,9 @@ class MyClockWidget(FloatLayout):
if color_prev == [1, 1, 1]:
img = Image.open("icons/" + x_label + ".png")
self.pollen_color_prev = color
if self.is_arm:
img = img.resize((int(img.width * 0.67), int(img.height * 0.67)))
self.paint_icon(color, img, "icon_" + x_label)
return color
@ -1620,15 +1622,15 @@ class MyClockWidget(FloatLayout):
minutes_hand = self.position_on_clock(t.minute/60+t.second/3600, length=0.40*hands.size[0])
hours_hand = self.position_on_clock(t.hour/12 + t.minute/720, length=0.35*hands.size[0])
if (0.05 <= touch.spos[0] <= 0.25) and (0.85 <= touch.spos[1] <= 0.95):
if (0.02 <= touch.spos[0] <= 0.28) and (0.82 <= touch.spos[1] <= 0.98):
if self.grabbed == "":
self.grabbed = "light_button"
self.on_light_button_pressed()
elif (0.05 <= touch.spos[0] <= 0.15) and (0.05 <= touch.spos[1] <= 0.15):
elif (0.02 <= touch.spos[0] <= 0.18) and (0.02 <= touch.spos[1] <= 0.18):
self.on_play_button_pressed()
elif (0.85 <= touch.spos[0] <= 0.95) and (0.05 <= touch.spos[1] <= 0.15):
elif (0.82 <= touch.spos[0] <= 0.98) and (0.02 <= touch.spos[1] <= 0.18):
self.on_alarm_button_pressed()
elif (0.85 <= touch.spos[0] <= 0.95) and (0.85 <= touch.spos[1] <= 0.95):
elif (0.82 <= touch.spos[0] <= 0.98) and (0.82 <= touch.spos[1] <= 0.98):
self.on_settings_button_pressed()
elif self.view == "set_alarm":
self.set_alarm_timeout_counter = 0