✨ feat(widget): restructure desktop widgets for better layout and extensibility
This commit is contained in:
1 file changed
+40
-31
+40
-31
@@ -453,38 +453,46 @@ 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(
|
||||||
orientation="h",
|
name="desktop-main-container",
|
||||||
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(
|
|
||||||
orientation="v",
|
orientation="v",
|
||||||
|
h_expand=True,
|
||||||
|
v_expand=True,
|
||||||
children=[
|
children=[
|
||||||
top_left,
|
# Top section
|
||||||
bottom_left,
|
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",
|
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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user