From 3bf13d7435746adfc4a55467060c426b73275cd2 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 1 Jun 2024 01:12:10 +0200 Subject: [PATCH] Improved navigation --- sbapp/main.py | 14 ++++++++++---- sbapp/ui/layouts.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index d145e14..f312531 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -935,7 +935,10 @@ class SidebandApp(MDApp): if text == "w": if self.root.ids.screen_manager.current == "conversations_screen": - self.quit_action(self) + if self.include_conversations and not self.include_objects: + self.quit_action(self) + else: + self.conversations_action(direction="right") elif self.root.ids.screen_manager.current == "map_settings_screen": self.close_sub_map_action() elif self.root.ids.screen_manager.current == "object_details_screen": @@ -1013,10 +1016,13 @@ class SidebandApp(MDApp): # Handle escape/back if key == 27: if self.root.ids.screen_manager.current == "conversations_screen": - if time.time() - self.last_exit_event < 2: - self.quit_action(self) + if not self.include_conversations and self.include_objects: + self.conversations_action(direction="right") else: - self.last_exit_event = time.time() + if time.time() - self.last_exit_event < 2: + self.quit_action(self) + else: + self.last_exit_event = time.time() else: if self.root.ids.screen_manager.current == "hardware_rnode_screen": diff --git a/sbapp/ui/layouts.py b/sbapp/ui/layouts.py index f9752ab..6ea48b8 100644 --- a/sbapp/ui/layouts.py +++ b/sbapp/ui/layouts.py @@ -62,7 +62,7 @@ MDNavigationLayout: OneLineIconListItem: - text: "Objects" + text: "Objects & Devices" on_release: root.ids.screen_manager.app.objects_action(self) # _no_ripple_effect: True