Add services/Demand.qml, which holds one count on a service's demand counter while active. It replaces 13 hand-written consumer counters across the bar, Control Center, dashboard, media and desktop widgets. The desktop Cava widget now releases Cava while its desktop is covered. Add components/JumpValue.qml for the "animate only visible jumps" rule shared by the dashboard gauge and resource bars. Move the Settings sidebar (search and navigation) into settings/SettingsSidebar.qml and the drag handle into settings/controls/SettingsDragArea.qml, halving Settings.qml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.4 KiB
QML
45 lines
1.4 KiB
QML
pragma ComponentBehavior: Bound
|
|
import QtQuick
|
|
import "../../services"
|
|
import "../../theme"
|
|
|
|
// Cava bars for system audio: rising bars, or mirrored around the centre line.
|
|
Face {
|
|
id: root
|
|
// Cava runs only while this widget's desktop is visible.
|
|
Demand {
|
|
service: CavaService
|
|
counter: "widgetConsumers"
|
|
active: root.desktopVisible
|
|
}
|
|
readonly property bool mirror: variant === "mirror"
|
|
Row {
|
|
id: bars
|
|
anchors.fill: parent
|
|
anchors.margins: 6
|
|
spacing: Math.max(2, width / 24 * 0.3)
|
|
Repeater {
|
|
model: 24
|
|
Item {
|
|
id: column
|
|
required property int index
|
|
readonly property real level: Math.max(0.03, CavaService.bars[index] || 0)
|
|
width: (bars.width - bars.spacing * 23) / 24
|
|
height: bars.height
|
|
Rectangle {
|
|
width: parent.width
|
|
height: Math.max(width, column.height * column.level)
|
|
y: root.mirror ? (column.height - height) / 2 : column.height - height
|
|
radius: width / 2
|
|
color: Qt.alpha(Theme.accentVivid, 0.55 + column.level * 0.45)
|
|
Behavior on height {
|
|
NumberAnimation {
|
|
duration: 60
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|