feat: added swich for timers_screen; refactor: commented out the non-working code and stubs

This commit is contained in:
Arduinum628
2025-11-30 15:34:49 +03:00
parent 9c3ec5c042
commit 7f0db608f6
3 changed files with 23 additions and 13 deletions

View File

@@ -9,6 +9,15 @@ class MenuApp:
menu: MDDropdownMenu = None menu: MDDropdownMenu = None
def switch_screen(self, item) -> None:
"""Переключает экран"""
screen_manager = self.root
match item.text:
case 'Таймеры':
screen_manager.current = 'timers_screen'
def open_menu(self, menu_button) -> None: def open_menu(self, menu_button) -> None:
"""Открывает выпадающее меню""" """Открывает выпадающее меню"""
@@ -18,7 +27,7 @@ class MenuApp:
'Цвет темы': lambda: self.set_palette(), 'Цвет темы': lambda: self.set_palette(),
'Стиль темы': lambda: self.switch_theme(), 'Стиль темы': lambda: self.switch_theme(),
'Тип схемы': lambda: self.set_scheme_type(), 'Тип схемы': lambda: self.set_scheme_type(),
'Новый таймер': None # 'Новый таймер': None
}.items(): }.items():
menu_items.append( menu_items.append(
{ {

View File

@@ -27,6 +27,7 @@
id: timers_nav id: timers_nav
icon: "timer-outline" icon: "timer-outline"
text: "Таймеры" text: "Таймеры"
on_release: app.switch_screen(self)
CommonNavigationRailItem: CommonNavigationRailItem:
id: guide_nav id: guide_nav

View File

@@ -54,21 +54,21 @@
MDButtonText: MDButtonText:
text: "Открыть" text: "Открыть"
MDButton: # MDButton:
timer_id: root.id # timer_id: root.id
style: "outlined" # style: "outlined"
size_hint_x: 1 # size_hint_x: 1
MDButtonText: # MDButtonText:
text: "Редактировать" # text: "Редактировать"
MDButton: # MDButton:
timer_id: root.id # timer_id: root.id
style: "outlined" # style: "outlined"
size_hint_x: 1 # size_hint_x: 1
MDButtonText: # MDButtonText:
text: "Удалить" # text: "Удалить"
# Основной экран # Основной экран
<TimersScreen>: <TimersScreen>: