Set Elsewhen's here by tapping a city on the globe (#13438)

A city on this machine's zone becomes homeCity, the zone's own city clears
it, and a city on another zone leaves it alone. Ported from omacom/elsewhen#5.

Co-authored-by: Shawn Yeager <shawn@shawnyeager.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-09-27 21:26:00 +02:00
1 parent e7218e36f2
commit 5929a9b80c
5 files changed
+38 -3

No files matched your search

+8
View File
@@ -118,6 +118,13 @@ Panel {
else g.showHome()
}
function claimHome(label, zone) {
var stored = Model.homeCityAfterTap(label, zone, setting("homeCity", ""), localZone)
if (stored === null) return
persistSettings({ homeCity: stored })
refreshFacts()
}
function focusFromGlobe(label, zone) {
var i = Model.indexOfZone(zones, label, zone)
if (i >= 0) focusOn(i)
@@ -876,6 +883,7 @@ Panel {
item.exitRequested.connect(function() { root.setGlobeMode(false, false) })
item.jumpDismissed.connect(function() { Qt.callLater(function() { keyCatcher.forceActiveFocus() }) })
item.citySelected.connect(function(label, zone) { root.focusFromGlobe(label, zone) })
item.cityTapped.connect(function(label, zone) { root.claimHome(label, zone) })
// A cold start can finish loading after the mode switched on.
if (root.globeMode) root.showFocusOnGlobe()
}