stable label widths via minText, increase group glow
This commit is contained in:
parent
7ab3b6ef75
commit
5de09fd5e2
9 changed files with 17 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: root.percent + "%"
|
label: root.percent + "%"
|
||||||
|
minText: "100%"
|
||||||
color: M.Theme.base0A
|
color: M.Theme.base0A
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Item {
|
||||||
anchors.fill: shadowSource
|
anchors.fill: shadowSource
|
||||||
shadowEnabled: true
|
shadowEnabled: true
|
||||||
shadowColor: root.borderColor
|
shadowColor: root.borderColor
|
||||||
shadowBlur: 0.6
|
shadowBlur: 1.0
|
||||||
shadowVerticalOffset: 0
|
shadowVerticalOffset: 0
|
||||||
shadowHorizontalOffset: 0
|
shadowHorizontalOffset: 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,17 @@ Text {
|
||||||
id: root
|
id: root
|
||||||
property string label: ""
|
property string label: ""
|
||||||
property string tooltip: ""
|
property string tooltip: ""
|
||||||
|
property string minText: ""
|
||||||
|
|
||||||
text: label
|
text: label
|
||||||
|
width: minText ? Math.max(implicitWidth, _minMetrics.width) : implicitWidth
|
||||||
|
|
||||||
|
TextMetrics {
|
||||||
|
id: _minMetrics
|
||||||
|
text: root.minText
|
||||||
|
font.pixelSize: root.font.pixelSize
|
||||||
|
font.family: root.font.family
|
||||||
|
}
|
||||||
color: M.Theme.base05
|
color: M.Theme.base05
|
||||||
font.pixelSize: M.Theme.fontSize
|
font.pixelSize: M.Theme.fontSize
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: Math.round(root.pct) + "%"
|
label: Math.round(root.pct) + "%"
|
||||||
|
minText: "100%"
|
||||||
color: root._stateColor
|
color: root._stateColor
|
||||||
opacity: root._blinkOpacity
|
opacity: root._blinkOpacity
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: root.usage.toString().padStart(2) + "%@" + root.freqGhz.toFixed(2)
|
label: root.usage.toString().padStart(2) + "%@" + root.freqGhz.toFixed(2)
|
||||||
|
minText: "99%@9.99"
|
||||||
color: M.Theme.base08
|
color: M.Theme.base08
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: root.freePct + "% " + root.totalTb.toFixed(1)
|
label: root.freePct + "% " + root.totalTb.toFixed(1)
|
||||||
|
minText: "100% 9.9"
|
||||||
color: M.Theme.base08
|
color: M.Theme.base08
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: root.percent + "%"
|
label: root.percent + "%"
|
||||||
|
minText: "100%"
|
||||||
color: M.Theme.base08
|
color: M.Theme.base08
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: root.celsius + "\u00B0C"
|
label: root.celsius + "\u00B0C"
|
||||||
|
minText: "100\u00B0C"
|
||||||
color: root._stateColor
|
color: root._stateColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
label: Math.round(root.volume * 100) + "%"
|
label: Math.round(root.volume * 100) + "%"
|
||||||
|
minText: "100%"
|
||||||
color: root.muted ? M.Theme.base04 : M.Theme.base0E
|
color: root.muted ? M.Theme.base04 : M.Theme.base0E
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue