import QtQuick // The Phoebus sun emblem, drawn with Canvas so it never depends on an SVG // image plugin. The installed vector is still emitted for the desktop and // boot surfaces; this is the in-app rendering. Item { id: emblem property color accent: Theme.amber property color core: Theme.warmWhite implicitWidth: 128 implicitHeight: 128 onAccentChanged: canvas.requestPaint() onCoreChanged: canvas.requestPaint() Canvas { id: canvas anchors.fill: parent onWidthChanged: requestPaint() onHeightChanged: requestPaint() Component.onCompleted: requestPaint() onPaint: { const ctx = getContext("2d"); ctx.reset(); const w = width; const h = height; const cx = w / 2; const cy = h / 2; const r = Math.min(w, h) / 2; const rays = 8; ctx.lineCap = "round"; ctx.strokeStyle = emblem.accent; ctx.fillStyle = emblem.accent; ctx.lineWidth = r * 0.09; for (let i = 0; i < rays; i++) { const a = i * (Math.PI * 2 / rays); ctx.beginPath(); ctx.moveTo(cx + Math.cos(a) * r * 0.62, cy + Math.sin(a) * r * 0.62); ctx.lineTo(cx + Math.cos(a) * r * 0.92, cy + Math.sin(a) * r * 0.92); ctx.stroke(); } ctx.lineWidth = r * 0.06; for (let j = 0; j < rays; j++) { const a = (j + 0.5) * (Math.PI * 2 / rays); ctx.beginPath(); ctx.moveTo(cx + Math.cos(a) * r * 0.66, cy + Math.sin(a) * r * 0.66); ctx.lineTo(cx + Math.cos(a) * r * 0.84, cy + Math.sin(a) * r * 0.84); ctx.stroke(); } ctx.beginPath(); ctx.arc(cx, cy, r * 0.40, 0, Math.PI * 2); ctx.fill(); ctx.beginPath(); ctx.arc(cx, cy, r * 0.25, 0, Math.PI * 2); ctx.fillStyle = emblem.core; ctx.fill(); } } }