* Move Elsewhen into Omarchy as omarchy.elsewhen The world clock ships in the shell tree instead of its own package. A migration renames existing bar entries with their settings and removes the retired package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove Elsewhen's shelved Earth row, overlap band and sky tint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tidy Elsewhen's models, data helper and docs, and drop currency Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restructure Elsewhen's panel and globe on the shared shell components Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Show Elsewhen's bar globe upright Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use the shared city search for Elsewhen's globe jump bar Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep legacy Elsewhen entries single and retry offline geocodes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fetch Elsewhen's weather with curl instead of a Python helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.2 KiB
QML
48 lines
1.2 KiB
QML
import QtQuick
|
|
import qs.Commons
|
|
import "GlobeModel.js" as Solar
|
|
|
|
// The night marker drawn as the moon's current phase. The faint full disc
|
|
// keeps it findable at new moon; the lit part is filled solid on top.
|
|
Item {
|
|
id: root
|
|
|
|
property real phase: 0 // 0 new, 0.25 first quarter, 0.5 full
|
|
property color color: Color.foreground
|
|
|
|
onPhaseChanged: canvas.requestPaint()
|
|
onColorChanged: canvas.requestPaint()
|
|
|
|
Canvas {
|
|
id: canvas
|
|
anchors.fill: parent
|
|
renderStrategy: Canvas.Cooperative
|
|
|
|
onPaint: {
|
|
var ctx = getContext("2d")
|
|
ctx.reset()
|
|
var r = Math.min(width, height) / 2
|
|
if (r <= 0) return
|
|
ctx.translate(width / 2, height / 2)
|
|
var c = root.color
|
|
|
|
// The whole disc, faint.
|
|
ctx.beginPath()
|
|
ctx.arc(0, 0, r, 0, Math.PI * 2)
|
|
ctx.fillStyle = Util.alpha(c, 0.22)
|
|
ctx.fill()
|
|
|
|
// The lit part, solid.
|
|
var lit = Solar.moonLitOutline(root.phase, r, 28)
|
|
if (lit.length > 2) {
|
|
ctx.beginPath()
|
|
ctx.moveTo(lit[0].x, lit[0].y)
|
|
for (var i = 1; i < lit.length; i++) ctx.lineTo(lit[i].x, lit[i].y)
|
|
ctx.closePath()
|
|
ctx.fillStyle = c
|
|
ctx.fill()
|
|
}
|
|
}
|
|
}
|
|
}
|