diff --git a/src/core/validation/widgets/komorebi/active_layout.py b/src/core/validation/widgets/komorebi/active_layout.py index 7d7df06..4a0398e 100644 --- a/src/core/validation/widgets/komorebi/active_layout.py +++ b/src/core/validation/widgets/komorebi/active_layout.py @@ -17,6 +17,11 @@ "paused": "[P]" }, 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, + 'animation': { + 'enabled': True, + 'type': 'fadeInOut', + 'duration': 200 + }, 'callbacks': { 'on_left': 'next_layout', 'on_middle': 'toggle_monocle', @@ -115,6 +120,24 @@ 'default': DEFAULTS['container_padding'], 'required': False }, + 'animation': { + 'type': 'dict', + 'schema': { + 'enabled': { + 'type': 'boolean', + 'default': DEFAULTS['animation']['enabled'] + }, + 'type': { + 'type': 'string', + 'default': DEFAULTS['animation']['type'] + }, + 'duration': { + 'type': 'integer', + 'default': DEFAULTS['animation']['duration'] + } + }, + 'default': DEFAULTS['animation'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/active_window.py b/src/core/validation/widgets/yasb/active_window.py index 437131e..8d896cc 100644 --- a/src/core/validation/widgets/yasb/active_window.py +++ b/src/core/validation/widgets/yasb/active_window.py @@ -17,6 +17,7 @@ 'processes': [], 'titles': [] }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -108,6 +109,29 @@ }, 'default': DEFAULTS['ignore_windows'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/battery.py b/src/core/validation/widgets/yasb/battery.py index 6922be8..3cc4fdb 100644 --- a/src/core/validation/widgets/yasb/battery.py +++ b/src/core/validation/widgets/yasb/battery.py @@ -27,6 +27,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -152,6 +153,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/bluetooth.py b/src/core/validation/widgets/yasb/bluetooth.py index 67fe838..37dbd13 100644 --- a/src/core/validation/widgets/yasb/bluetooth.py +++ b/src/core/validation/widgets/yasb/bluetooth.py @@ -73,8 +73,26 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] }, 'callbacks': { 'type': 'dict', diff --git a/src/core/validation/widgets/yasb/brightness.py b/src/core/validation/widgets/yasb/brightness.py index 300f387..a1a4fd8 100644 --- a/src/core/validation/widgets/yasb/brightness.py +++ b/src/core/validation/widgets/yasb/brightness.py @@ -87,8 +87,26 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] }, 'animation': { 'type': 'dict', diff --git a/src/core/validation/widgets/yasb/clock.py b/src/core/validation/widgets/yasb/clock.py index 764dfca..4b72fbc 100644 --- a/src/core/validation/widgets/yasb/clock.py +++ b/src/core/validation/widgets/yasb/clock.py @@ -10,6 +10,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -69,6 +70,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/cpu.py b/src/core/validation/widgets/yasb/cpu.py index 5eb976c..6c11743 100644 --- a/src/core/validation/widgets/yasb/cpu.py +++ b/src/core/validation/widgets/yasb/cpu.py @@ -19,6 +19,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -75,6 +76,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/custom.py b/src/core/validation/widgets/yasb/custom.py index c8db732..bdf77ab 100644 --- a/src/core/validation/widgets/yasb/custom.py +++ b/src/core/validation/widgets/yasb/custom.py @@ -12,6 +12,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': "toggle_label", 'on_middle': "do_nothing", @@ -88,6 +89,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/github.py b/src/core/validation/widgets/yasb/github.py index 0e390df..fdb9245 100644 --- a/src/core/validation/widgets/yasb/github.py +++ b/src/core/validation/widgets/yasb/github.py @@ -14,7 +14,8 @@ 'enabled': True, 'type': 'fadeInOut', 'duration': 200 - } + }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0} } VALIDATION_SCHEMA = { @@ -83,5 +84,28 @@ } }, 'default': DEFAULTS['animation'] + }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] } } diff --git a/src/core/validation/widgets/yasb/home.py b/src/core/validation/widgets/yasb/home.py index 33fd9ed..cf8b662 100644 --- a/src/core/validation/widgets/yasb/home.py +++ b/src/core/validation/widgets/yasb/home.py @@ -39,8 +39,26 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] }, 'power_menu': { 'type': 'boolean', diff --git a/src/core/validation/widgets/yasb/language.py b/src/core/validation/widgets/yasb/language.py index 66b300a..ac856ef 100644 --- a/src/core/validation/widgets/yasb/language.py +++ b/src/core/validation/widgets/yasb/language.py @@ -7,6 +7,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -48,6 +49,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/libre_monitor.py b/src/core/validation/widgets/yasb/libre_monitor.py index 48ac362..164e34e 100644 --- a/src/core/validation/widgets/yasb/libre_monitor.py +++ b/src/core/validation/widgets/yasb/libre_monitor.py @@ -32,6 +32,7 @@ 'on_middle': 'do_nothing', 'on_right': 'do_nothing' }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'animation': { 'enabled': True, 'type': 'fadeInOut', @@ -163,6 +164,29 @@ }, 'default': DEFAULTS['callbacks'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'animation': { 'type': 'dict', 'required': False, diff --git a/src/core/validation/widgets/yasb/media.py b/src/core/validation/widgets/yasb/media.py index a40a4e4..9f63ade 100644 --- a/src/core/validation/widgets/yasb/media.py +++ b/src/core/validation/widgets/yasb/media.py @@ -6,6 +6,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'toggle_label', 'on_middle': 'do_nothing', @@ -45,6 +46,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/memory.py b/src/core/validation/widgets/yasb/memory.py index 38dbc9d..8cf0640 100644 --- a/src/core/validation/widgets/yasb/memory.py +++ b/src/core/validation/widgets/yasb/memory.py @@ -7,6 +7,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': "toggle_label", 'on_middle': "do_nothing", @@ -79,6 +80,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/microphone.py b/src/core/validation/widgets/yasb/microphone.py index 284282e..fc712bd 100644 --- a/src/core/validation/widgets/yasb/microphone.py +++ b/src/core/validation/widgets/yasb/microphone.py @@ -62,8 +62,26 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] }, 'callbacks': { 'type': 'dict', diff --git a/src/core/validation/widgets/yasb/obs.py b/src/core/validation/widgets/yasb/obs.py index cf6baf0..855c53f 100644 --- a/src/core/validation/widgets/yasb/obs.py +++ b/src/core/validation/widgets/yasb/obs.py @@ -11,7 +11,7 @@ }, 'hide_when_not_recording': False, 'blinking_icon': True, - 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0} } VALIDATION_SCHEMA = { @@ -43,7 +43,25 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False - }, + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + } } \ No newline at end of file diff --git a/src/core/validation/widgets/yasb/power_menu.py b/src/core/validation/widgets/yasb/power_menu.py index 09f5061..9ec1b0b 100644 --- a/src/core/validation/widgets/yasb/power_menu.py +++ b/src/core/validation/widgets/yasb/power_menu.py @@ -4,7 +4,8 @@ 'blur': False, 'blur_background': True, 'animation_duration': 200, - 'button_row': 3 + 'button_row': 3, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0} } VALIDATION_SCHEMA = { @@ -37,6 +38,29 @@ 'min': 1, 'max': 5 }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'buttons': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/traffic.py b/src/core/validation/widgets/yasb/traffic.py index adcb164..2434a60 100644 --- a/src/core/validation/widgets/yasb/traffic.py +++ b/src/core/validation/widgets/yasb/traffic.py @@ -7,6 +7,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, "callbacks": { "on_left": "toggle_label", "on_middle": "do_nothing", @@ -41,7 +42,30 @@ } }, 'default': DEFAULTS['animation'] - }, + }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, "callbacks": { "type": "dict", "schema": { diff --git a/src/core/validation/widgets/yasb/volume.py b/src/core/validation/widgets/yasb/volume.py index 13780eb..0d49e1a 100644 --- a/src/core/validation/widgets/yasb/volume.py +++ b/src/core/validation/widgets/yasb/volume.py @@ -14,6 +14,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_middle': 'do_nothing', 'on_right': 'do_nothing' @@ -61,6 +62,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/wallpapers.py b/src/core/validation/widgets/yasb/wallpapers.py index 98dfec8..69dc535 100644 --- a/src/core/validation/widgets/yasb/wallpapers.py +++ b/src/core/validation/widgets/yasb/wallpapers.py @@ -23,7 +23,8 @@ 'enabled': True, 'type': 'fadeInOut', 'duration': 200 - } + }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, } VALIDATION_SCHEMA = { @@ -144,5 +145,28 @@ } }, 'default': DEFAULTS['animation'] + }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] } } diff --git a/src/core/validation/widgets/yasb/weather.py b/src/core/validation/widgets/yasb/weather.py index 91f2818..38da0ff 100644 --- a/src/core/validation/widgets/yasb/weather.py +++ b/src/core/validation/widgets/yasb/weather.py @@ -33,6 +33,7 @@ 'type': 'fadeInOut', 'duration': 200 }, + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'callbacks': { 'on_left': 'do_nothing', 'on_middle': 'do_nothing', @@ -176,6 +177,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/whkd.py b/src/core/validation/widgets/yasb/whkd.py index 718071a..e22e19c 100644 --- a/src/core/validation/widgets/yasb/whkd.py +++ b/src/core/validation/widgets/yasb/whkd.py @@ -33,7 +33,25 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False - }, + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + } } \ No newline at end of file diff --git a/src/core/validation/widgets/yasb/wifi.py b/src/core/validation/widgets/yasb/wifi.py index 1588f6b..69cdce2 100644 --- a/src/core/validation/widgets/yasb/wifi.py +++ b/src/core/validation/widgets/yasb/wifi.py @@ -15,6 +15,7 @@ "\udb82\udd28" # Icon for 75-100% strength ], 'ethernet_icon': "\ueba9", + 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, 'animation': { 'enabled': True, 'type': 'fadeInOut', @@ -68,6 +69,29 @@ }, 'default': DEFAULTS['animation'] }, + 'container_padding': { + 'type': 'dict', + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] + }, 'callbacks': { 'type': 'dict', 'schema': { diff --git a/src/core/validation/widgets/yasb/windows_desktops.py b/src/core/validation/widgets/yasb/windows_desktops.py index d0377eb..af3c58e 100644 --- a/src/core/validation/widgets/yasb/windows_desktops.py +++ b/src/core/validation/widgets/yasb/windows_desktops.py @@ -20,7 +20,25 @@ }, 'container_padding': { 'type': 'dict', - 'default': DEFAULTS['container_padding'], - 'required': False + 'required': False, + 'schema': { + 'top': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['top'] + }, + 'left': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['left'] + }, + 'bottom': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['bottom'] + }, + 'right': { + 'type': 'integer', + 'default': DEFAULTS['container_padding']['right'] + } + }, + 'default': DEFAULTS['container_padding'] } } \ No newline at end of file diff --git a/src/core/widgets/komorebi/active_layout.py b/src/core/widgets/komorebi/active_layout.py index 306d874..a761081 100644 --- a/src/core/widgets/komorebi/active_layout.py +++ b/src/core/widgets/komorebi/active_layout.py @@ -9,6 +9,7 @@ from core.widgets.base import BaseWidget from core.utils.komorebi.client import KomorebiClient from core.validation.widgets.komorebi.active_layout import VALIDATION_SCHEMA +from core.utils.widgets.animation_manager import AnimationManager try: from core.utils.komorebi.event_listener import KomorebiEventListener @@ -46,7 +47,7 @@ class ActiveLayoutWidget(BaseWidget): validation_schema = VALIDATION_SCHEMA event_listener = KomorebiEventListener - def __init__(self, label: str, layouts: list[str], layout_icons: dict[str, str], hide_if_offline: bool, container_padding: dict, callbacks: dict[str, str]): + def __init__(self, label: str, layouts: list[str], layout_icons: dict[str, str], hide_if_offline: bool, container_padding: dict, animation: dict[str, str], callbacks: dict[str, str]): super().__init__(class_name="komorebi-active-layout") self._label = label self._layout_icons = layout_icons @@ -64,7 +65,7 @@ def __init__(self, label: str, layouts: list[str], layout_icons: dict[str, str], self._active_layout_text = QLabel() self._active_layout_text.setProperty("class", "label") self._active_layout_text.setAlignment(Qt.AlignmentFlag.AlignCenter) - + self._animation = animation # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) @@ -110,12 +111,16 @@ def _next_layout(self): if self._is_shift_layout_allowed(): self._layouts.rotate(1) self._komorebic.change_layout(self._layouts[0]) - + if self._animation['enabled']: + AnimationManager.animate(self, self._animation['type'], self._animation['duration']) + def _prev_layout(self): if self._is_shift_layout_allowed(): self._layouts.rotate(-1) self._komorebic.change_layout(self._layouts[0]) - + if self._animation['enabled']: + AnimationManager.animate(self, self._animation['type'], self._animation['duration']) + def _is_shift_layout_allowed(self): return not bool( not self._focused_workspace.get('tile', False) or diff --git a/src/core/widgets/yasb/active_window.py b/src/core/widgets/yasb/active_window.py index 988b332..dc64955 100644 --- a/src/core/widgets/yasb/active_window.py +++ b/src/core/widgets/yasb/active_window.py @@ -50,7 +50,8 @@ def __init__( monitor_exclusive: bool, animation: dict[str, str], max_length: int, - max_length_ellipsis: str + max_length_ellipsis: str, + container_padding: dict[str, int], ): super().__init__(class_name="active-window-widget") self._win_info = None @@ -68,11 +69,11 @@ def __init__( self._event_service = EventService() self._update_retry_count = 0 self._animation = animation - + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/applications.py b/src/core/widgets/yasb/applications.py index f79d37a..794e7ad 100644 --- a/src/core/widgets/yasb/applications.py +++ b/src/core/widgets/yasb/applications.py @@ -19,7 +19,7 @@ def __init__( app_list: list[str, dict[str]], image_icon_size: int, animation: dict[str, str], - container_padding: dict + container_padding: dict[str, int], ): super().__init__(class_name=f"apps-widget {class_name}") self._label = label diff --git a/src/core/widgets/yasb/battery.py b/src/core/widgets/yasb/battery.py index 34eaab8..ea8932b 100644 --- a/src/core/widgets/yasb/battery.py +++ b/src/core/widgets/yasb/battery.py @@ -21,7 +21,8 @@ def __init__( status_thresholds: dict[str, int], status_icons: dict[str, str], animation: dict[str, str], - callbacks: dict[str, str] + callbacks: dict[str, str], + container_padding: dict[str, int], ): super().__init__(update_interval, class_name="battery-widget") self._time_remaining_natural = time_remaining_natural @@ -34,14 +35,15 @@ def __init__( self._animation = animation self._icon_charging_format = charging_options['icon_format'] self._icon_charging_blink = charging_options['blink_charging_icon'] - + self._padding = container_padding + self._show_alt_label = False self._label_content = label self._label_alt_content = label_alt # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/clock.py b/src/core/widgets/yasb/clock.py index 5501589..018d6e3 100644 --- a/src/core/widgets/yasb/clock.py +++ b/src/core/widgets/yasb/clock.py @@ -21,6 +21,7 @@ def __init__( update_interval: int, timezones: list[str], animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict[str, str], ): super().__init__(update_interval, class_name="clock-widget") @@ -32,6 +33,7 @@ def __init__( self._active_datetime_format = None self._animation = animation self._label_content = label + self._padding = container_padding self._label_alt_content = label_alt if self._locale: import locale @@ -40,7 +42,7 @@ def __init__( # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/cpu.py b/src/core/widgets/yasb/cpu.py index 99b49b8..2fe9ae9 100644 --- a/src/core/widgets/yasb/cpu.py +++ b/src/core/widgets/yasb/cpu.py @@ -17,6 +17,7 @@ def __init__( histogram_num_columns: int, update_interval: int, animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict[str, str] ): super().__init__(update_interval, class_name="cpu-widget") @@ -27,10 +28,11 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/custom.py b/src/core/widgets/yasb/custom.py index f1f1397..fbae665 100644 --- a/src/core/widgets/yasb/custom.py +++ b/src/core/widgets/yasb/custom.py @@ -42,6 +42,7 @@ def __init__( exec_options: dict, callbacks: dict, animation: dict[str, str], + container_padding: dict[str, int], class_name: str ): super().__init__(exec_options['run_interval'], class_name=f"custom-widget {class_name}") @@ -54,10 +55,11 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/github.py b/src/core/widgets/yasb/github.py index c9f8882..509cd70 100644 --- a/src/core/widgets/yasb/github.py +++ b/src/core/widgets/yasb/github.py @@ -46,6 +46,7 @@ def __init__( menu_offset: str, update_interval: int, animation: dict[str, str], + container_padding: dict[str, int] ): super().__init__((update_interval * 1000), class_name="github-widget") self._menu_open = False @@ -62,9 +63,10 @@ def __init__( self._max_field_size = max_field_size self._animation = animation self._github_data = [] + self._padding = container_padding self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/language.py b/src/core/widgets/yasb/language.py index 6a546de..6211727 100644 --- a/src/core/widgets/yasb/language.py +++ b/src/core/widgets/yasb/language.py @@ -28,7 +28,8 @@ def __init__( label_alt: str, update_interval: int, animation: dict[str, str], - callbacks: dict[str, str], + container_padding: dict[str, int], + callbacks: dict[str, str] ): super().__init__(int(update_interval * 1000), class_name="language-widget") @@ -36,11 +37,12 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/libre_monitor.py b/src/core/widgets/yasb/libre_monitor.py index b52a325..466e587 100644 --- a/src/core/widgets/yasb/libre_monitor.py +++ b/src/core/widgets/yasb/libre_monitor.py @@ -35,6 +35,7 @@ def __init__( server_username: str, server_password: str, animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict, ): super().__init__(update_interval, class_name=class_name) @@ -57,10 +58,11 @@ def __init__( self._server_username = server_username self._server_password = server_password self._animation = animation + self._padding = container_padding # UI self._widget_container_layout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) self._widget_container = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/media.py b/src/core/widgets/yasb/media.py index 9a59624..c07a074 100644 --- a/src/core/widgets/yasb/media.py +++ b/src/core/widgets/yasb/media.py @@ -37,6 +37,7 @@ def __init__( thumbnail_corner_radius: int, icons: dict[str, str], animation: dict[str, str], + container_padding: dict[str, int] ): super().__init__(class_name="media-widget") self._label_content = label @@ -52,10 +53,11 @@ def __init__( self._thumbnail_corner_radius = thumbnail_corner_radius self._hide_empty = hide_empty self._animation = animation + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/memory.py b/src/core/widgets/yasb/memory.py index 95530bb..a150b67 100644 --- a/src/core/widgets/yasb/memory.py +++ b/src/core/widgets/yasb/memory.py @@ -17,7 +17,8 @@ def __init__( update_interval: int, animation: dict[str, str], callbacks: dict[str, str], - memory_thresholds: dict[str, int] + memory_thresholds: dict[str, int], + container_padding: dict[str, int] ): super().__init__(update_interval, class_name="memory-widget") self._memory_thresholds = memory_thresholds @@ -25,10 +26,12 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding + # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/power_menu.py b/src/core/widgets/yasb/power_menu.py index b2d72cd..bf007fc 100644 --- a/src/core/widgets/yasb/power_menu.py +++ b/src/core/widgets/yasb/power_menu.py @@ -107,7 +107,7 @@ def update_uptime_display(self): class PowerMenuWidget(BaseWidget): validation_schema = VALIDATION_SCHEMA - def __init__(self, label: str, uptime: bool, blur: bool, blur_background: bool, animation_duration: int, button_row: int, buttons: dict[str, list[str]]): + def __init__(self, label: str, uptime: bool, blur: bool, blur_background: bool, animation_duration: int, button_row: int, container_padding: dict[str, int],buttons: dict[str, list[str]]): super().__init__(0, class_name="power-menu-widget") self.buttons = buttons @@ -116,12 +116,27 @@ def __init__(self, label: str, uptime: bool, blur: bool, blur_background: bool, self.blur_background = blur_background self.animation_duration = animation_duration self.button_row = button_row - + self._padding = container_padding + self._button = ClickableLabel(label) self._button.setProperty("class", "label power-button") self._button.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) self._button.setAlignment(Qt.AlignmentFlag.AlignCenter) - self.widget_layout.addWidget(self._button) + + # Construct container + self._widget_container_layout: QHBoxLayout = QHBoxLayout() + self._widget_container_layout.setSpacing(0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) + # Initialize container + + self._widget_container: QWidget = QWidget() + self._widget_container.setLayout(self._widget_container_layout) + self._widget_container.setProperty("class", "widget-container") + # Add the container to the main widget layout + self.widget_layout.addWidget(self._widget_container) + self._widget_container_layout.addWidget(self._button) + + self._button.clicked.connect(self.show_main_window) self.main_window = None diff --git a/src/core/widgets/yasb/traffic.py b/src/core/widgets/yasb/traffic.py index aa943fa..d709118 100644 --- a/src/core/widgets/yasb/traffic.py +++ b/src/core/widgets/yasb/traffic.py @@ -21,6 +21,7 @@ def __init__( label_alt: str, update_interval: int, animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict[str, str], ): super().__init__(update_interval, class_name="traffic-widget") @@ -30,10 +31,12 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding + # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/volume.py b/src/core/widgets/yasb/volume.py index 637f5b8..e4fea80 100644 --- a/src/core/widgets/yasb/volume.py +++ b/src/core/widgets/yasb/volume.py @@ -42,6 +42,7 @@ def __init__( tooltip: bool, volume_icons: list[str], animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict[str, str] ): super().__init__(class_name="volume-widget") @@ -50,12 +51,12 @@ def __init__( self._label_alt_content = label_alt self._tooltip = tooltip self._animation = animation - + self._padding = container_padding self.volume = None self._volume_icons = volume_icons self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) self._widget_container.setProperty("class", "widget-container") @@ -67,6 +68,7 @@ def __init__( self.callback_left = "toggle_mute" self.callback_right = callbacks["on_right"] self.callback_middle = callbacks["on_middle"] + self._padding = container_padding self.cb = AudioEndpointChangeCallback(self) self.enumerator = AudioUtilities.GetDeviceEnumerator() diff --git a/src/core/widgets/yasb/wallpapers.py b/src/core/widgets/yasb/wallpapers.py index 4f083ac..2c38203 100644 --- a/src/core/widgets/yasb/wallpapers.py +++ b/src/core/widgets/yasb/wallpapers.py @@ -37,6 +37,7 @@ def __init__( tooltip: bool, animation: dict[str, str], run_after: list[str], + container_padding: dict[str, int], gallery: dict = None ): """Initialize the WallpapersWidget with configuration parameters.""" @@ -51,6 +52,7 @@ def __init__( self._run_after = run_after self._gallery = gallery self._animation = animation + self._padding = container_padding self._last_image = None self._is_running = False @@ -58,7 +60,7 @@ def __init__( # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout) diff --git a/src/core/widgets/yasb/weather.py b/src/core/widgets/yasb/weather.py index 8f38dde..b98389a 100644 --- a/src/core/widgets/yasb/weather.py +++ b/src/core/widgets/yasb/weather.py @@ -29,6 +29,7 @@ def __init__( weather_card: dict[str, str], callbacks: dict[str, str], icons: dict[str, str], + container_padding: dict[str, int], animation: dict[str, str] ): super().__init__((update_interval * 1000), class_name="weather-widget") @@ -40,6 +41,7 @@ def __init__( self._api_key = api_key if api_key != 'env' else os.getenv('YASB_WEATHER_API_KEY') self.api_url = f"http://api.weatherapi.com/v1/forecast.json?key={self._api_key}&q={urllib.parse.quote(self._location)}&days=3&aqi=no&alerts=no" self._units = units + self._padding = container_padding # Store weather data self.weather_data = None self._show_alt_label = False @@ -50,7 +52,7 @@ def __init__( # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() diff --git a/src/core/widgets/yasb/wifi.py b/src/core/widgets/yasb/wifi.py index d1e28d7..c047c57 100644 --- a/src/core/widgets/yasb/wifi.py +++ b/src/core/widgets/yasb/wifi.py @@ -18,6 +18,7 @@ def __init__( wifi_icons: list[str], ethernet_icon: str, animation: dict[str, str], + container_padding: dict[str, int], callbacks: dict[str, str], ): super().__init__(update_interval, class_name="wifi-widget") @@ -28,10 +29,11 @@ def __init__( self._label_content = label self._label_alt_content = label_alt self._animation = animation + self._padding = container_padding # Construct container self._widget_container_layout: QHBoxLayout = QHBoxLayout() self._widget_container_layout.setSpacing(0) - self._widget_container_layout.setContentsMargins(0, 0, 0, 0) + self._widget_container_layout.setContentsMargins(self._padding['left'],self._padding['top'],self._padding['right'],self._padding['bottom']) # Initialize container self._widget_container: QWidget = QWidget() self._widget_container.setLayout(self._widget_container_layout)