Move Elsewhen into Omarchy as omarchy.elsewhen (#13429)
* 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>
This commit is contained in:
1 parent
5c7cef1e78
commit
e7218e36f2
37 files changed
+6780
-155
No files matched your search
@@ -0,0 +1,128 @@
|
||||
import QtQuick
|
||||
import qs.Commons
|
||||
|
||||
// The selected city under the globe: name, local time and badge, then its
|
||||
// zone and offset. Blank without a selection; the parent reserves the height.
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property var city: null // [name, zone, lat, lon, rank]
|
||||
property bool daylight: false
|
||||
property string clock: ""
|
||||
property string offsetLabel: ""
|
||||
property string badge: "" // "home", "tracked" or ""
|
||||
property real moonPhase: 0.5
|
||||
property color foreground: Color.foreground
|
||||
property color dim: Qt.darker(foreground, 1.55)
|
||||
property color fainter: Qt.darker(foreground, 2.1)
|
||||
property color daylightMarker
|
||||
property string fontFamily: Style.font.family
|
||||
|
||||
signal offsetClicked()
|
||||
|
||||
readonly property bool has: city !== null && city !== undefined
|
||||
|
||||
// The mark matches the ink height of the name's capital; a pixel less, since
|
||||
// a circle's antialiased edge reads a pixel wider than a glyph's.
|
||||
TextMetrics {
|
||||
id: capHeight
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
font.weight: Font.DemiBold
|
||||
text: "M"
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.space(1)
|
||||
visible: root.has
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Style.space(7)
|
||||
|
||||
Row {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.space(4)
|
||||
|
||||
// A lit dot by day, tonight's moon by night, as on the rows' strips.
|
||||
// Placed on the name's baseline by y: anchors.baseline inside a Row loops.
|
||||
Rectangle {
|
||||
y: cityName.baselineOffset - height
|
||||
width: Math.max(6, Math.round(capHeight.tightBoundingRect.height) - 1)
|
||||
height: width
|
||||
radius: width / 2
|
||||
visible: root.has
|
||||
color: root.daylight ? root.daylightMarker : "transparent"
|
||||
|
||||
MoonDot {
|
||||
anchors.fill: parent
|
||||
visible: !root.daylight
|
||||
phase: root.moonPhase
|
||||
color: root.foreground
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: cityName
|
||||
textFormat: Text.PlainText
|
||||
text: root.has ? root.city[0] : ""
|
||||
color: root.foreground
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
textFormat: Text.PlainText
|
||||
text: root.clock
|
||||
visible: text !== ""
|
||||
color: root.dim
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
textFormat: Text.PlainText
|
||||
text: root.badge
|
||||
visible: root.has && text !== ""
|
||||
color: Color.accent
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
}
|
||||
}
|
||||
|
||||
// Zone and offset together are the toggle, so it survives a blank offset.
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Style.space(6)
|
||||
|
||||
Text {
|
||||
textFormat: Text.PlainText
|
||||
text: root.has ? root.city[1] : ""
|
||||
color: offsetHover.hovered ? root.dim : root.fainter
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
}
|
||||
|
||||
Text {
|
||||
textFormat: Text.PlainText
|
||||
text: root.offsetLabel
|
||||
visible: text !== ""
|
||||
color: offsetHover.hovered ? root.foreground : root.dim
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: Style.font.caption
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: offsetHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler { onTapped: root.offsetClicked() }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user