Auslösefläche: die Vorschau zeigt wieder einen Bildschirm

Dein Hintergrundbild liegt in ~/Desktop, und dorthin lässt macOS keine App
ohne Freigabe. NSWorkspace gibt den Pfad trotzdem heraus, NSImage gibt danach
still nil zurück — und die Vorschau blieb schwarz, ohne jeden Hinweis worauf.
Gemessen: isReadableFile meldet false, das Laden schlägt fehl.

Um eine Ordnerfreigabe zu bitten, nur um ein Vorschaubildchen zu malen, wäre
die falsche Frage. Also wird jetzt vorher geprüft, ob sich die Datei lesen
lässt, und wenn nicht, kommt ein Standardhintergrund von macOS —
/System/Library/Desktop Pictures, von neu nach alt durchgesehen, hier landet
es bei Sonoma. Die Bilder liegen auf jedem Mac und werden nur gelesen.

Geladen über CGImageSource statt NSImage: die Vorlagen sind 6016 Punkte im
Quadrat und zwanzig Megabyte schwer, gebraucht werden tausend Punkte. Und ein
Hintergrundbild kann mehrere Bilder enthalten, hell und dunkel im selben HEIC.

Das Dekodieren dauert gut hundert Millisekunden, deshalb läuft es neben dem
Zeichnen statt davor — sonst hätte das Fenster beim Öffnen so lange gestanden.
Danach liegt das Bild im Cache.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-08-13 23:30:43 +02:00
parent 2aa60eedf9
commit 6c92e7fed6
4 changed files with 2606 additions and 2462 deletions

View File

@@ -1,155 +1,169 @@
{
"sourceLanguage": "en",
"strings": {
"weather.error.timeout": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Zeitüberschreitung beim Abruf"
"sourceLanguage" : "en",
"strings" : {
"↑ %@" : {
"comment" : "A label that shows the high temperature. The argument is the high temperature.",
"extractionState" : "stale",
"isCommentAutoGenerated" : true,
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "↑ %@"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "Request timed out"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "↑ %@"
}
}
}
},
"weather.feelsLike %@": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "gefühlt %@"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "feels like %@"
"↑ %@ ↓ %@" : {
"comment" : "Temperaturbereich.",
"isCommentAutoGenerated" : true,
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "↑ %1$@ ↓ %2$@"
}
}
}
},
"widget.weather.asOf": {
"comment": "%@ ist die Uhrzeit des Messwerts",
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Stand %@"
"↓ %@" : {
"comment" : "A label that reads \"low\" in the weather app.",
"extractionState" : "stale",
"isCommentAutoGenerated" : true,
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "↓ %@"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "As of %@"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : " %@"
}
}
}
},
"widget.weather.locationDenied": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Kein Standortzugriff.\nOrt in den Einstellungen wählen."
"weather.error.timeout" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Zeitüberschreitung beim Abruf"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "No location access.\nPick a place in settings."
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Request timed out"
}
}
}
},
"widget.weather.locationUndetermined": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Standort noch nicht erlaubt.\nIn den Einstellungen freigeben."
"weather.feelsLike %@" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "gefühlt %@"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "Location not allowed yet.\nGrant it in settings."
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "feels like %@"
}
}
}
},
"widget.weather.name": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Wetter"
"widget.weather.asOf" : {
"comment" : "%@ ist die Uhrzeit des Messwerts",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Stand %@"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "Weather"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "As of %@"
}
}
}
},
"widget.weather.unavailable": {
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "Wetter nicht abrufbar"
"widget.weather.locationDenied" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Kein Standortzugriff.\nOrt in den Einstellungen wählen."
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "Weather unavailable"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "No location access.\nPick a place in settings."
}
}
}
},
"↑ %@": {
"comment": "A label that shows the high temperature. The argument is the high temperature.",
"isCommentAutoGenerated": true,
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "↑ %@"
"widget.weather.locationUndetermined" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Standort noch nicht erlaubt.\nIn den Einstellungen freigeben."
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "↑ %@"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Location not allowed yet.\nGrant it in settings."
}
}
}
},
"↓ %@": {
"comment": "A label that reads \"low\" in the weather app.",
"isCommentAutoGenerated": true,
"localizations": {
"de": {
"stringUnit": {
"state": "translated",
"value": "↓ %@"
"widget.weather.name" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Wetter"
}
},
"en": {
"stringUnit": {
"state": "translated",
"value": "↓ %@"
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Weather"
}
}
}
},
"widget.weather.unavailable" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Wetter nicht abrufbar"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Weather unavailable"
}
}
}
}
},
"version": "1.1"
}
"version" : "1.1"
}