From 7f0db608f62a6e81cb010a4f42e3a6787c3c8374 Mon Sep 17 00:00:00 2001 From: Arduinum628 Date: Sun, 30 Nov 2025 15:34:49 +0300 Subject: [PATCH] feat: added swich for timers_screen; refactor: commented out the non-working code and stubs --- kawai_focus/menu_app.py | 11 ++++++++++- kv/navigation_panel.kv | 1 + kv/timers_screen.kv | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/kawai_focus/menu_app.py b/kawai_focus/menu_app.py index de23f12..830b6ac 100644 --- a/kawai_focus/menu_app.py +++ b/kawai_focus/menu_app.py @@ -9,6 +9,15 @@ class MenuApp: 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: """Открывает выпадающее меню""" @@ -18,7 +27,7 @@ class MenuApp: 'Цвет темы': lambda: self.set_palette(), 'Стиль темы': lambda: self.switch_theme(), 'Тип схемы': lambda: self.set_scheme_type(), - 'Новый таймер': None + # 'Новый таймер': None }.items(): menu_items.append( { diff --git a/kv/navigation_panel.kv b/kv/navigation_panel.kv index d9d528f..f74277e 100644 --- a/kv/navigation_panel.kv +++ b/kv/navigation_panel.kv @@ -27,6 +27,7 @@ id: timers_nav icon: "timer-outline" text: "Таймеры" + on_release: app.switch_screen(self) CommonNavigationRailItem: id: guide_nav diff --git a/kv/timers_screen.kv b/kv/timers_screen.kv index b72e304..d8d5e78 100644 --- a/kv/timers_screen.kv +++ b/kv/timers_screen.kv @@ -54,21 +54,21 @@ MDButtonText: text: "Открыть" - MDButton: - timer_id: root.id - style: "outlined" - size_hint_x: 1 + # MDButton: + # timer_id: root.id + # style: "outlined" + # size_hint_x: 1 - MDButtonText: - text: "Редактировать" + # MDButtonText: + # text: "Редактировать" - MDButton: - timer_id: root.id - style: "outlined" - size_hint_x: 1 + # MDButton: + # timer_id: root.id + # style: "outlined" + # size_hint_x: 1 - MDButtonText: - text: "Удалить" + # MDButtonText: + # text: "Удалить" # Основной экран :