refactor(modules/desktop): simplify Deskwidgets to manage windows instead of being a window
- Refactored Deskwidgets to no longer inherit from Window, now managing windows via attributes. - Removed unnecessary initialization parameters and size settings. - Updated class comment to reflect the new responsibilities.
This commit is contained in:
1 file changed
+3
-12
@@ -607,22 +607,13 @@ class CpuInfo(SystemInfoBase):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class Deskwidgets(Window):
|
class Deskwidgets:
|
||||||
"""Desktop widgets manager - handles all desktop widgets."""
|
"""Desktop widgets manager - handles all desktop widgets."""
|
||||||
|
|
||||||
config = load_config()
|
config = load_config()
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self):
|
||||||
# Create the main invisible window that manages the widgets
|
# This class now just manages other windows instead of being one itself
|
||||||
super().__init__(
|
|
||||||
name="desktop-widget-manager",
|
|
||||||
layer="bottom",
|
|
||||||
title="modus-desktop-widget-manager",
|
|
||||||
visible=False, # This window is invisible - just manages the others
|
|
||||||
size=(1, 1), # Minimal size
|
|
||||||
anchor="top left",
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create separate independent windows as attributes
|
# Create separate independent windows as attributes
|
||||||
self.top_left = Window(
|
self.top_left = Window(
|
||||||
|
|||||||
Reference in new issue
Block a user