frat: added screen timers_screen, added new buttons: back, delete_timer, new_timer and the functionality is connected to them, udated fuc list_timers() for work with timers_screens for data;

This commit is contained in:
Arduinum628
2025-08-21 00:01:34 +03:00
parent ca6de5351a
commit 92765001be
10 changed files with 386 additions and 40 deletions

49
kv/timers_screen.kv Normal file
View File

@@ -0,0 +1,49 @@
#:kivy 2.3.1
<TimersScreen>:
FloatLayout:
RecycleView:
id: timers_view
size_hint: 1, 1
pos_hint: {"x": 0, "y": 0}
viewclass: "TimerButton"
RecycleBoxLayout:
default_size: None, dp(50)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: "vertical"
spacing: dp(5)
Button:
id: new_timer
text: 'Новый таймер'
size_hint: None, None
height: 40
width: 120
pos_hint: {"center_x": 0.3, "center_y": 0.1}
on_release: root.switch_new_timer(self)
<TimerButton@Button>:
timer_id: None
text: ""
on_release: app.root.get_screen("timers_screen").switch_timer(self)
size_hint: None, None
height: dp(50)
background_normal: "" # отключаем стандартный фон
background_color: 0, 0, 0, 0 # прозрачный
canvas.before:
Color:
rgba: 1, 1, 1, 1 # белый контур
Line:
width: 1.5
rectangle: (self.x, self.y, self.width, self.height)
Color:
rgba: (0, 0.5, 1, 0.5) if self.state == "down" else (0, 0, 0, 0)
Rectangle:
pos: self.pos
size: self.size