OSD: fix vertical layout

autoformat
This commit is contained in:
lysec
2025-10-11 18:18:43 +02:00
parent df6fdf3656
commit 3dff242606
5 changed files with 15 additions and 13 deletions
@@ -9,6 +9,7 @@ import qs.Widgets
NBox {
id: root
property real scaling: 1.0
property real localOutputVolume: AudioService.volume
property real localInputVolume: AudioService.inputVolume
@@ -9,6 +9,8 @@ import qs.Widgets
NBox {
id: root
property real scaling: 1.0
Item {
id: content
anchors.fill: parent
@@ -23,8 +25,8 @@ NBox {
icon: "cpu-usage"
flat: true
contentScale: 0.8
width: 70 * scaling
height: 65 * scaling
scaling: root.scaling
Layout.alignment: Qt.AlignHCenter
}
NCircleStat {
@@ -33,8 +35,8 @@ NBox {
icon: "cpu-temperature"
flat: true
contentScale: 0.8
width: 70 * scaling
height: 65 * scaling
scaling: root.scaling
Layout.alignment: Qt.AlignHCenter
}
NCircleStat {
@@ -42,8 +44,8 @@ NBox {
icon: "memory"
flat: true
contentScale: 0.8
width: 70 * scaling
height: 65 * scaling
scaling: root.scaling
Layout.alignment: Qt.AlignHCenter
}
NCircleStat {
@@ -51,8 +53,8 @@ NBox {
icon: "storage"
flat: true
contentScale: 0.8
width: 70 * scaling
height: 65 * scaling
scaling: root.scaling
Layout.alignment: Qt.AlignHCenter
}
}
@@ -63,6 +63,7 @@ NPanel {
SystemMonitorCard {
Layout.preferredWidth: Style.baseWidgetSize * 2.625 * scaling
Layout.fillHeight: true
scaling: root.scaling
}
}
@@ -70,6 +71,7 @@ NPanel {
AudioCard {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(120 * scaling)
scaling: root.scaling
}
// Bottom actions (two grouped rows of round buttons)
+5 -9
View File
@@ -348,15 +348,11 @@ Variants {
})()
property int vMarginTop: Math.max(Math.round(osdItem.radius), Math.round(Style.marginS * root.scaling))
property int balanceDelta: Math.round(Style.marginS * root.scaling)
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.fill: parent
anchors.topMargin: vMarginTop
anchors.bottomMargin: vMargin
width: (function () {
const w = parent.width - (vMargin * 2)
return (w % 2 === 0) ? w : w - 1
})()
anchors.leftMargin: vMargin
anchors.rightMargin: vMargin
anchors.bottomMargin: 0
spacing: Math.round(Style.marginS * root.scaling)
// Percentage text at top
@@ -418,7 +414,7 @@ Variants {
color: root.getIconColor()
pointSize: Style.fontSizeXL * root.scaling
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.bottomMargin: vMargin + Math.round(Style.marginM * root.scaling) + balanceDelta
Layout.bottomMargin: Math.round(Style.marginS * root.scaling)
Behavior on color {
ColorAnimation {
duration: Style.animationNormal
+1
View File
@@ -8,6 +8,7 @@ import qs.Widgets
Rectangle {
id: root
property real scaling: 1.0
property real value: 0 // 0..100 (or any range visually mapped)
property string icon: ""
property string suffix: "%"