✨ feat(widget): restructure desktop widgets for better layout and extensibility

This commit is contained in:
sankalp committed 2025-08-03 19:15:00 +05:45
1 parent 21364fe56c
commit ac056ed51d
1 file changed
+27 -18
+27 -18
View File
@@ -453,12 +453,24 @@ class Deskwidgets(Window):
config = load_config() config = load_config()
def __init__(self, **kwargs): def __init__(self, **kwargs):
top_left = Window( # Create the main container with proper layout
anchor="top left", main_container = Box(
name="desktop-main-container",
orientation="v",
h_expand=True,
v_expand=True,
children=[
# Top section
Box(
name="desktop-top-section",
orientation="h", orientation="h",
layer="bottom", h_expand=True,
child=Box( v_expand=True,
v_align="start",
children=[
Box(
name="desktop-widgets-container", name="desktop-widgets-container",
orientation="h",
children=[ children=[
Box( Box(
orientation="v", orientation="v",
@@ -471,20 +483,16 @@ class Deskwidgets(Window):
WeatherContainer(), WeatherContainer(),
], ],
), ),
) ],
),
bottom_left = Window( # Bottom section (empty for now, but expandable)
anchor="bottom left", Box(
name="desktop-bottom-section",
orientation="h", orientation="h",
layer="bottom", h_expand=True,
child=Box(), v_expand=True,
) v_align="end",
),
container = Box(
orientation="v",
children=[
top_left,
bottom_left,
], ],
) )
@@ -492,9 +500,10 @@ class Deskwidgets(Window):
name="desktop", name="desktop",
layer="bottom", layer="bottom",
title="desktop-widgets", title="desktop-widgets",
anchor="top left",
orientation="v", orientation="v",
exclusivity="none", exclusivity="none",
child=container, child=main_container,
**kwargs, **kwargs,
) )