Share demand counting and jump easing; split Settings sidebar
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>
This commit is contained in:
1 parent
99e64a7713
commit
bf0ef09cec
18 files changed
+595
-570
No files matched your search
@@ -12,17 +12,10 @@ Item {
|
||||
property bool desktopVisible: true
|
||||
// Faces showing live metrics keep the shared collector running only while shown.
|
||||
property bool usesMetrics: false
|
||||
readonly property bool sampling: usesMetrics && desktopVisible
|
||||
property bool counted: false
|
||||
function count(next) {
|
||||
if (next !== counted) {
|
||||
MetricsService.consumers += next ? 1 : -1;
|
||||
counted = next;
|
||||
}
|
||||
Demand {
|
||||
service: MetricsService
|
||||
active: face.usesMetrics && face.desktopVisible
|
||||
}
|
||||
onSamplingChanged: count(sampling)
|
||||
Component.onCompleted: count(sampling)
|
||||
Component.onDestruction: count(false)
|
||||
// Reference size for typography that scales with the widget.
|
||||
readonly property real unit: Math.min(width, height * 2)
|
||||
}
|
||||
@@ -6,8 +6,12 @@ import "../../theme"
|
||||
// Cava bars for system audio: rising bars, or mirrored around the centre line.
|
||||
Face {
|
||||
id: root
|
||||
Component.onCompleted: CavaService.widgetConsumers++
|
||||
Component.onDestruction: CavaService.widgetConsumers--
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user