pragma ComponentBehavior: Bound import QtQuick import qs.hyprchrome.theme // Segmented horizontal meter: a row of cells lit up to `value`. // // A copy of the dense bar's meter rather than a reuse of it — that one is an // inline component inside DenseBarContent.qml and so is not visible from any // other file (the same reason BarPanel inlines its own MicroText). Row { id: meter property int segments: 16 property real value: 0 // 0..1 property bool ready: false property real warn: 0.85 // fraction at which the lit cells go hot readonly property real fraction: Math.max(0, Math.min(1, meter.value)) readonly property bool hot: meter.ready && meter.fraction >= meter.warn readonly property color litColor: meter.hot ? Theme.hot : Theme.accent spacing: 2 Repeater { model: meter.segments Rectangle { required property int index readonly property bool lit: meter.ready && index < Math.round(meter.fraction * meter.segments) width: Math.max(2, (meter.width - (meter.segments - 1) * meter.spacing) / meter.segments) height: meter.height color: lit ? meter.litColor : Theme.textAlpha(0.06) border.width: 1 border.color: lit ? meter.litColor : Theme.textAlpha(0.18) } } }