feat(bar): enhancing the media widget

The Media widget has been enhanced with a new MediaDisplayFormat
configuration option that controls how the widget is displayed. It
supports seven formats: Icon, Text, IconAndText (the default),
ControlsOnly, IconAndControls, TextAndControls, and Full.

The widget now detects whether the Previous and Next buttons are
actually available for the current media session using the Windows Media
Control API. When a button is not available, it appears dimmed at 50
percent opacity and clicking it has no effect.

Tooltips were added to improve usability. Hovering over the media info
label shows the full artist and title text, which is helpful when the
text is truncated. The Play/Pause button also shows the media info on
hover.

The rendering logic was refactored to properly handle right-aligned
widgets.

When the Media widget is placed in right_widgets, the UI renders items
from right to left, so the code now renders elements in reverse order to
ensure the visual appearance remains consistent regardless of which
panel the widget is placed in.
This commit is contained in:
Csaba
2026-02-04 08:56:35 +01:00
committed by LGUG2Z
parent 5d7a0ea9ad
commit 9977cca500
3 changed files with 297 additions and 16 deletions

View File

@@ -3863,6 +3863,17 @@
"description": "Media widget configuration",
"type": "object",
"properties": {
"display": {
"description": "Display format of the media widget (defaults to IconAndText)",
"anyOf": [
{
"$ref": "#/$defs/MediaDisplayFormat"
},
{
"type": "null"
}
]
},
"enable": {
"description": "Enable the Media widget",
"type": "boolean"
@@ -3872,6 +3883,46 @@
"enable"
]
},
"MediaDisplayFormat": {
"description": "Media widget display format",
"oneOf": [
{
"description": "Show only the media info icon",
"type": "string",
"const": "Icon"
},
{
"description": "Show only the media info text (artist - title)",
"type": "string",
"const": "Text"
},
{
"description": "Show both icon and text",
"type": "string",
"const": "IconAndText"
},
{
"description": "Show only the control buttons (previous, play/pause, next)",
"type": "string",
"const": "ControlsOnly"
},
{
"description": "Show icon with control buttons",
"type": "string",
"const": "IconAndControls"
},
{
"description": "Show text with control buttons",
"type": "string",
"const": "TextAndControls"
},
{
"description": "Show icon, text, and control buttons",
"type": "string",
"const": "Full"
}
]
},
"MemoryConfig": {
"description": "Memory widget configuration",
"type": "object",