Im Band ist Platz für mehr als einen Wert
Die Begründung für „ein Wert je Seite" war falsch gerechnet: der Arm ist bei fünf Kacheln je 376 Punkte breit, und ein Wert braucht davon knapp sechzig. Die Zahl im Kopf war die der schmalen Insel, nicht die des ausgefahrenen Arms. Jetzt bis zu vier Elemente je Seite, in wählbarer Reihenfolge — Uhr, Wetter, Akku, CPU, Speicher, Temperatur. Kein Ziehen zum Umsortieren: bei höchstens vier Einträgen ist Herausnehmen und wieder Hinzufügen schneller als eine Ziehgeste, die man erst finden muss. „Nichts" ist keine Wahl mehr, sondern die leere Liste — zwei Wege, dasselbe zu sagen, waren einer zu viel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e3b215a1dd
commit
fd29df51cf
+19
-9
@@ -85,22 +85,32 @@ final class AppModel {
|
||||
}
|
||||
}
|
||||
|
||||
/// Was links neben der Notch steht.
|
||||
var bandLeading: BandAccessory {
|
||||
/// Was links neben der Notch steht, in dieser Reihenfolge.
|
||||
///
|
||||
/// Eine Liste und keine einzelne Wahl: der Arm ist bei fünf Kacheln rund
|
||||
/// 376 Punkte breit, und ein Wert braucht davon knapp sechzig.
|
||||
var bandLeading: [BandAccessory] {
|
||||
didSet {
|
||||
guard bandLeading != oldValue else { return }
|
||||
defaults.set(bandLeading.rawValue, forKey: Keys.bandLeading)
|
||||
defaults.set(bandLeading.map(\.rawValue), forKey: Keys.bandLeading)
|
||||
}
|
||||
}
|
||||
|
||||
/// Was rechts daneben steht.
|
||||
var bandTrailing: BandAccessory {
|
||||
var bandTrailing: [BandAccessory] {
|
||||
didSet {
|
||||
guard bandTrailing != oldValue else { return }
|
||||
defaults.set(bandTrailing.rawValue, forKey: Keys.bandTrailing)
|
||||
defaults.set(bandTrailing.map(\.rawValue), forKey: Keys.bandTrailing)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wie viele Elemente je Seite höchstens.
|
||||
///
|
||||
/// Vier passen bei fünf Kacheln bequem. Wer weniger Kacheln zeigt, hat
|
||||
/// schmalere Arme — dann wird das Letzte abgeschnitten, und das ist die
|
||||
/// ehrlichere Grenze als eine Zahl, die für jede Panelbreite stimmen müsste.
|
||||
static let bandLimit = 4
|
||||
|
||||
/// Notch oder Insel — die Form, die Onyx oben annimmt.
|
||||
var notchStyle: NotchStyle {
|
||||
didSet {
|
||||
@@ -206,10 +216,10 @@ final class AppModel {
|
||||
|
||||
// Die bisherige feste Verdrahtung als Voreinstellung: wer nichts
|
||||
// einstellt, sieht, was vorher auch dastand.
|
||||
self.bandLeading = defaults.string(forKey: Keys.bandLeading)
|
||||
.flatMap(BandAccessory.init(rawValue:)) ?? .weather
|
||||
self.bandTrailing = defaults.string(forKey: Keys.bandTrailing)
|
||||
.flatMap(BandAccessory.init(rawValue:)) ?? .battery
|
||||
self.bandLeading = (defaults.stringArray(forKey: Keys.bandLeading)
|
||||
.map { $0.compactMap(BandAccessory.init(rawValue:)) }) ?? [.weather]
|
||||
self.bandTrailing = (defaults.stringArray(forKey: Keys.bandTrailing)
|
||||
.map { $0.compactMap(BandAccessory.init(rawValue:)) }) ?? [.battery]
|
||||
self.notchWidths = (defaults.dictionary(forKey: Keys.notchWidths) as? [String: Double] ?? [:])
|
||||
.reduce(into: [CGDirectDisplayID: CGFloat]()) { result, entry in
|
||||
guard let id = CGDirectDisplayID(entry.key) else { return }
|
||||
|
||||
Reference in New Issue
Block a user