From ac056ed51d17dfe843a180cfe73cae0db7a60e33 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 3 Aug 2025 19:15:00 +0545 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(widget):=20restructure=20deskt?= =?UTF-8?q?op=20widgets=20for=20better=20layout=20and=20extensibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/widget.py | 71 ++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/modules/widget.py b/modules/widget.py index a707d23..503e9c1 100644 --- a/modules/widget.py +++ b/modules/widget.py @@ -453,38 +453,46 @@ class Deskwidgets(Window): config = load_config() def __init__(self, **kwargs): - top_left = Window( - anchor="top left", - orientation="h", - layer="bottom", - child=Box( - name="desktop-widgets-container", - children=[ - Box( - orientation="v", - name="box-widget", - v_expand=True, - v_align="center", - h_align="center", - children=[Date()], - ), - WeatherContainer(), - ], - ), - ) - - bottom_left = Window( - anchor="bottom left", - orientation="h", - layer="bottom", - child=Box(), - ) - - container = Box( + # Create the main container with proper layout + main_container = Box( + name="desktop-main-container", orientation="v", + h_expand=True, + v_expand=True, children=[ - top_left, - bottom_left, + # Top section + Box( + name="desktop-top-section", + orientation="h", + h_expand=True, + v_expand=True, + v_align="start", + children=[ + Box( + name="desktop-widgets-container", + orientation="h", + children=[ + Box( + orientation="v", + name="box-widget", + v_expand=True, + v_align="center", + h_align="center", + children=[Date()], + ), + WeatherContainer(), + ], + ), + ], + ), + # Bottom section (empty for now, but expandable) + Box( + name="desktop-bottom-section", + orientation="h", + h_expand=True, + v_expand=True, + v_align="end", + ), ], ) @@ -492,9 +500,10 @@ class Deskwidgets(Window): name="desktop", layer="bottom", title="desktop-widgets", + anchor="top left", orientation="v", exclusivity="none", - child=container, + child=main_container, **kwargs, )