diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-07-14 13:41:57 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-07-14 13:41:57 +0800 |
| commit | ec8d08da329fc0087e67b9ffa62425480109ec81 (patch) | |
| tree | bf8e6e63626a2b2ed2cd3aa688297f08ad98171e /bar/Mpris.qml | |
| parent | ef063de5341a5459389ea474d12e5db03e9af67d (diff) | |
mpris: better ratio with text and rect width/height
Diffstat (limited to 'bar/Mpris.qml')
| -rw-r--r-- | bar/Mpris.qml | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/bar/Mpris.qml b/bar/Mpris.qml index b85b064..2530511 100644 --- a/bar/Mpris.qml +++ b/bar/Mpris.qml @@ -46,24 +46,34 @@ Item { } } - implicitWidth: rect.width - General.rectMargin / 2 - height: Bar.height + General.rectMargin / 2 + implicitWidth: rect.width - General.rectMargin / 1.25 + height: Bar.height + General.rectMargin / 1.5 // TODO fancy animation progress bar etc. Rectangle { id: rect anchors.verticalCenter: parent.verticalCenter // TODO: move to IRect - implicitWidth: text.width + General.rectMargin * 4 + implicitWidth: layout.width + General.rectMargin * 5 height: parent.height - General.rectMargin color: Colors.alt radius: Style.rounding.smaller - IText { - id: text - // TODO: use IText + RowLayout { + id: layout anchors.centerIn: parent - anchors.verticalCenter: parent.verticalCenter - text: root.state + " " + root.cleanedTitle + " [" + root.progress + "]" + spacing: Bar.resourceIconTextSpacing / 1.5 + RowLayout { + spacing: Bar.resourceIconTextSpacing + Icon { + text: root.state + } + IText { + text: root.cleanedTitle + } + } + IText { + text: "[" + root.progress + "]" + } } } |
