Files
glassMxrph/quickshell/compat/noctalia/Widgets/NBusyIndicator.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

67 lines
1.7 KiB
QML

import QtQuick
import qs.compat.noctalia.Commons
Item {
id: root
property bool running: true
property color color: Color.mPrimary
property int size: Style.baseWidgetSize
property int strokeWidth: Style.borderL
property int duration: Style.animationSlow * 2
implicitWidth: size
implicitHeight: size
onColorChanged: canvas.requestPaint()
// GPU-optimized spinner - draw once, rotate with GPU transform
Item {
id: spinner
anchors.fill: parent
// Static canvas - drawn ONCE, then cached
Canvas {
id: canvas
anchors.fill: parent
renderStrategy: Canvas.Cooperative // Better performance than Threaded for simple shapes
renderTarget: Canvas.FramebufferObject // GPU texture
// Enable layer caching - critical for performance!
layer.enabled: true
layer.smooth: true
Component.onCompleted: {
requestPaint();
}
onPaint: {
var ctx = getContext("2d");
ctx.reset();
var centerX = width / 2;
var centerY = height / 2;
var radius = Math.min(width, height) / 2 - strokeWidth / 2;
ctx.strokeStyle = root.color;
ctx.lineWidth = Math.max(1, root.strokeWidth);
ctx.lineCap = "round";
// Draw arc with gap (270 degrees = 3/4 of circle)
ctx.beginPath();
ctx.arc(centerX, centerY, radius, -Math.PI / 2, -Math.PI / 2 + Math.PI * 1.5);
ctx.stroke();
}
}
// Smooth rotation animation - uses GPU transform, NO canvas repaints!
RotationAnimation on rotation {
running: root.running
from: 0
to: 360
duration: root.duration
loops: Animation.Infinite
}
}
}