import QtQuick import "../../services" // Base for desktop widget faces; DesktopWidget binds these after loading. Item { id: face property string widgetId property string kind property string variant property var options: ({}) // False while windows cover this widget's desktop: faces pause motion and sampling. 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; } } 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) }