✨ feat(dashboard): add dashboard UI and functionality with Bluetooth and Network tiles

This commit is contained in:
sankalp committed 2025-07-27 12:06:05 +05:45
1 parent a85e606022
commit e61fadd43c
6 files changed
+209 -410

No files matched your search

+1 -2
View File
@@ -39,10 +39,9 @@ class BluetoothDeviceSlot(CenterBox):
children=[
Image(icon_name=device.icon_name + "-symbolic", size=16),
Label(
label=device.name,
label=device.name[:8] + "..." if len(device.name) > 8 else device.name,
h_expand=True,
h_align="start",
ellipsization="end",
),
self.connection_label,
],
+2 -8
View File
@@ -13,7 +13,7 @@ from utils.wayland import WaylandWindow as Window
class Dashboard(Box):
def __init__(self, **kwargs):
super().__init__(
name="dashboard",
name="dashboard-box",
visible=True,
orientation="v",
spacing=8,
@@ -31,10 +31,7 @@ class Dashboard(Box):
self.wifi.dashboard_instance = self
self.bluetooth.dashboard_instance = self
# Create real notifications component
self.dashboard_notifications = DashboardNotifications()
# Track currently active tile
self.active_tile = None
self.tiles = Box(
@@ -117,9 +114,6 @@ class Dashboard(Box):
self.content_stack.set_visible_child(self.default_content)
print("Showing default content")
# Don't change tile visual states - keep all tiles unchanged
print("Tile handling complete")
def reset_to_default(self):
"""Reset dashboard to default state (notifications visible, no active tile)"""
print("Resetting dashboard to default state")
@@ -140,7 +134,7 @@ class DashboardWindow(Window):
self.dashboard = Dashboard()
super().__init__(
name="dashboard-window",
name="dashboard",
layer="top",
anchor="bottom",
exclusivity="none",
+6 -1
View File
@@ -163,7 +163,12 @@ class Network(Tile):
if wifi and wifi.active_access_point:
connected = True
con_label = wifi.active_access_point.ssid
# Hacky truncation: limit to 8 characters and add ellipsis
ssid = wifi.active_access_point.ssid
if len(ssid) > 8:
con_label = ssid[:8] + "..."
else:
con_label = ssid
elif wifi and not wifi.wireless_enabled:
con_label = "Off"