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>
52 lines
2.0 KiB
QML
52 lines
2.0 KiB
QML
import QtQuick 6.8 // 6.12 added a QtQuick Color singleton that hides Commons.Color
|
|
import qs.compat.noctalia.Commons
|
|
|
|
Item {
|
|
id: root
|
|
property color fillColor: Color.mPrimary
|
|
property color strokeColor: Color.mOnSurface
|
|
property int strokeWidth: 0
|
|
property var values: []
|
|
property bool vertical: false
|
|
property bool mirrored: true
|
|
|
|
// Minimum signal properties
|
|
property bool showMinimumSignal: false
|
|
property real minimumSignalValue: 0.01 // Default to 1% of height
|
|
|
|
// Pre-compute mirroring
|
|
readonly property int valuesCount: (values && values.length !== undefined) ? values.length : 0
|
|
readonly property int totalBars: mirrored ? valuesCount * 2 : valuesCount
|
|
readonly property real barSlotSize: totalBars > 0 ? (vertical ? height : width) / totalBars : 0
|
|
readonly property bool highQuality: (Settings.data.audio.visualizerType === "low") ? false : true
|
|
readonly property real centerY: height / 2
|
|
readonly property real centerX: width / 2
|
|
|
|
Repeater {
|
|
model: root.totalBars
|
|
|
|
Rectangle {
|
|
property int valueIndex: root.mirrored ? (index < root.valuesCount ? root.valuesCount - 1 - index : index - root.valuesCount) : index
|
|
|
|
property real rawAmp: (root.values && root.values[valueIndex] !== undefined) ? root.values[valueIndex] : 0
|
|
property real amp: (root.showMinimumSignal && rawAmp === 0) ? root.minimumSignalValue : rawAmp
|
|
|
|
property real barSize: (vertical ? root.width : root.height) * amp
|
|
|
|
color: root.fillColor
|
|
border.color: root.strokeColor
|
|
border.width: root.strokeWidth
|
|
antialiasing: root.highQuality
|
|
smooth: root.highQuality
|
|
|
|
width: vertical ? barSize : root.barSlotSize * 0.8
|
|
height: vertical ? root.barSlotSize * 0.8 : barSize
|
|
x: vertical ? root.centerX - (barSize / 2) : index * root.barSlotSize + (root.barSlotSize * 0.25)
|
|
y: vertical ? index * root.barSlotSize + (root.barSlotSize * 0.25) : root.centerY - (barSize / 2)
|
|
|
|
// Disable updates when invisible to save GPU
|
|
visible: root.visible
|
|
}
|
|
}
|
|
}
|