Qt 6.12's QtQuick exports a Color singleton, which hides the Omarchy and Noctalia kits' Commons.Color: every Color.foreground read undefined, so plugin buttons, toggles and text fell back to black. The kits now import QtQuick 6.8, which predates it, and the installer pins the same version in plugin files that use Color (reinstall plugins to pick it up). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.1 KiB
QML
29 lines
1.1 KiB
QML
import QtQuick 6.8 // 6.12 added a QtQuick Color singleton that hides Commons.Color
|
|
import qs.compat.noctalia.Commons
|
|
import qs.compat.noctalia.Services.UI
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
// Mandatory properties for gauges
|
|
required property int orientation // Qt.Vertical || Qt.Horizontal
|
|
required property real ratio // 0..1
|
|
|
|
radius: orientation === Qt.Vertical ? width / 2 : height / 2
|
|
color: Color.mOutline
|
|
property color fillColor: Color.mPrimary
|
|
|
|
// Fill that grows from bottom if vertical and left if horizontal.
|
|
// Snap to zero if the computed pixel length is sub-pixel (< 1px).
|
|
Rectangle {
|
|
readonly property real clampedRatio: Math.min(1, Math.max(0, root.ratio))
|
|
readonly property real rawFill: (orientation === Qt.Vertical ? root.height : root.width) * clampedRatio
|
|
width: orientation === Qt.Vertical ? root.width : (rawFill < 1 ? 0 : rawFill)
|
|
height: orientation === Qt.Vertical ? (rawFill < 1 ? 0 : rawFill) : root.height
|
|
radius: root.radius
|
|
color: root.fillColor
|
|
anchors.bottom: orientation === Qt.Vertical ? parent.bottom : undefined
|
|
anchors.left: parent.left
|
|
}
|
|
}
|