From f76533df2661dddda69ed421eeaeeaa5932809f7 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 27 Jul 2025 01:58:04 +0545 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(dashboard):=20use?= =?UTF-8?q?=20direct=20method=20calls=20instead=20of=20fabric-cli=20for=20?= =?UTF-8?q?tile=20menu=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dashboard/main.py | 4 ++++ modules/dashboard/tile.py | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/dashboard/main.py b/modules/dashboard/main.py index 5387b07..cb085eb 100644 --- a/modules/dashboard/main.py +++ b/modules/dashboard/main.py @@ -28,6 +28,10 @@ class Dashboard(Box): props=self.mini_player, mini_props=self.mini_player.get_mini_view() ) + # Set dashboard instance reference for tiles that need it + self.wifi.dashboard_instance = self + self.bluetooth.dashboard_instance = self + # Create real notifications component self.dashboard_notifications = DashboardNotifications() diff --git a/modules/dashboard/tile.py b/modules/dashboard/tile.py index a019515..89035e6 100644 --- a/modules/dashboard/tile.py +++ b/modules/dashboard/tile.py @@ -5,7 +5,6 @@ from fabric.widgets.stack import Stack from fabric.widgets.revealer import Revealer from fabric.widgets.centerbox import CenterBox import utils.icons as icons -from fabric.utils.helpers import exec_shell_command_async class Tile(Box): @@ -20,6 +19,7 @@ class Tile(Box): style_classes="tile-label", label=label, h_align="start" ) self.toggle = False + self.dashboard_instance = None # Will be set by the dashboard self.type_box = Box( style_classes="tile-type", @@ -86,12 +86,10 @@ class Tile(Box): self.menu.add_style_class("expand") self.menu.remove_style_class("contract") print(self.toggle, self.get_name()) - name = self.get_name() - exec_shell_command_async( - f"fabric-cli exec bar-example \"notch.dashboard.handle_tile_menu_expand('{ - name - }', {self.toggle})\"" - ) + + # Call dashboard method directly instead of using fabric-cli + if self.dashboard_instance: + self.dashboard_instance.handle_tile_menu_expand(self.get_name(), self.toggle) def mini_view(self): self.content_button.set_reveal_child(False)