diff --git a/modules/Backlight.qml b/modules/Backlight.qml index cd1749e..91b4897 100644 --- a/modules/Backlight.qml +++ b/modules/Backlight.qml @@ -66,6 +66,7 @@ M.BarSection { } M.BarLabel { label: root.percent + "%" + minText: "100%" color: M.Theme.base0A anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/BarGroup.qml b/modules/BarGroup.qml index 878e38d..5237165 100644 --- a/modules/BarGroup.qml +++ b/modules/BarGroup.qml @@ -31,7 +31,7 @@ Item { anchors.fill: shadowSource shadowEnabled: true shadowColor: root.borderColor - shadowBlur: 0.6 + shadowBlur: 1.0 shadowVerticalOffset: 0 shadowHorizontalOffset: 0 } diff --git a/modules/BarLabel.qml b/modules/BarLabel.qml index f5cff64..5fe262b 100644 --- a/modules/BarLabel.qml +++ b/modules/BarLabel.qml @@ -6,8 +6,17 @@ Text { id: root property string label: "" property string tooltip: "" + property string minText: "" 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 font.pixelSize: M.Theme.fontSize font.family: M.Theme.fontFamily diff --git a/modules/Battery.qml b/modules/Battery.qml index 6e0970e..bcde3ff 100644 --- a/modules/Battery.qml +++ b/modules/Battery.qml @@ -63,6 +63,7 @@ M.BarSection { } M.BarLabel { label: Math.round(root.pct) + "%" + minText: "100%" color: root._stateColor opacity: root._blinkOpacity anchors.verticalCenter: parent.verticalCenter diff --git a/modules/Cpu.qml b/modules/Cpu.qml index 01ea93d..764e193 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -59,6 +59,7 @@ M.BarSection { } M.BarLabel { label: root.usage.toString().padStart(2) + "%@" + root.freqGhz.toFixed(2) + minText: "99%@9.99" color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/Disk.qml b/modules/Disk.qml index 37d682f..90700b6 100644 --- a/modules/Disk.qml +++ b/modules/Disk.qml @@ -39,6 +39,7 @@ M.BarSection { } M.BarLabel { label: root.freePct + "% " + root.totalTb.toFixed(1) + minText: "100% 9.9" color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/Memory.qml b/modules/Memory.qml index 284629e..6461c7c 100644 --- a/modules/Memory.qml +++ b/modules/Memory.qml @@ -39,6 +39,7 @@ M.BarSection { } M.BarLabel { label: root.percent + "%" + minText: "100%" color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/Temperature.qml b/modules/Temperature.qml index 0c94b3c..8177b8d 100644 --- a/modules/Temperature.qml +++ b/modules/Temperature.qml @@ -30,6 +30,7 @@ M.BarSection { } M.BarLabel { label: root.celsius + "\u00B0C" + minText: "100\u00B0C" color: root._stateColor anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/Volume.qml b/modules/Volume.qml index 86c44d4..f3eb1ac 100644 --- a/modules/Volume.qml +++ b/modules/Volume.qml @@ -25,6 +25,7 @@ M.BarSection { } M.BarLabel { label: Math.round(root.volume * 100) + "%" + minText: "100%" color: root.muted ? M.Theme.base04 : M.Theme.base0E anchors.verticalCenter: parent.verticalCenter }