summaryrefslogtreecommitdiff
path: root/bar/Mpris.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-14 13:41:57 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-14 13:41:57 +0800
commitec8d08da329fc0087e67b9ffa62425480109ec81 (patch)
treebf8e6e63626a2b2ed2cd3aa688297f08ad98171e /bar/Mpris.qml
parentef063de5341a5459389ea474d12e5db03e9af67d (diff)
mpris: better ratio with text and rect width/height
Diffstat (limited to 'bar/Mpris.qml')
-rw-r--r--bar/Mpris.qml26
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 + "]"
+ }
}
}