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
+54
-14
@@ -203,22 +203,10 @@ private struct NotchSettings: View {
|
||||
OnyxFormCard(String(localized: "settings.band"),
|
||||
hint: String(localized: "settings.band.hint")) {
|
||||
OnyxFormRow(String(localized: "settings.band.leading")) {
|
||||
Picker("", selection: $model.bandLeading) {
|
||||
ForEach(BandAccessory.allCases, id: \.self) { kind in
|
||||
Text(kind.localizedName).tag(kind)
|
||||
}
|
||||
}
|
||||
.labelsHidden()
|
||||
.frame(width: 200)
|
||||
BandEditor(items: $model.bandLeading)
|
||||
}
|
||||
OnyxFormRow(String(localized: "settings.band.trailing")) {
|
||||
Picker("", selection: $model.bandTrailing) {
|
||||
ForEach(BandAccessory.allCases, id: \.self) { kind in
|
||||
Text(kind.localizedName).tag(kind)
|
||||
}
|
||||
}
|
||||
.labelsHidden()
|
||||
.frame(width: 200)
|
||||
BandEditor(items: $model.bandTrailing)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,3 +723,55 @@ private struct NotchWidthSettings: View {
|
||||
set: { model.setNotchWidth($0, for: id) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Die Elemente einer Bandseite: was drin ist, in welcher Reihenfolge, und was
|
||||
/// sich hinzufügen lässt.
|
||||
///
|
||||
/// Kein Ziehen zum Umsortieren. Die Liste hat höchstens vier Einträge, und für
|
||||
/// vier Einträge ist Herausnehmen und wieder Hinzufügen schneller als jede
|
||||
/// Ziehgeste — die man außerdem erst finden muss.
|
||||
private struct BandEditor: View {
|
||||
@Binding var items: [BandAccessory]
|
||||
|
||||
private var available: [BandAccessory] {
|
||||
BandAccessory.allCases.filter { !items.contains($0) }
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: Onyx.Space.sm) {
|
||||
ForEach(items, id: \.self) { item in
|
||||
HStack(spacing: Onyx.Space.xs) {
|
||||
Text(item.localizedName)
|
||||
.font(Onyx.Font.footnote)
|
||||
Button {
|
||||
items.removeAll { $0 == item }
|
||||
} label: {
|
||||
Image(systemName: "xmark")
|
||||
.font(.system(size: Onyx.Symbol.caption))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.padding(.horizontal, Onyx.Space.sm)
|
||||
.padding(.vertical, Onyx.Space.xs)
|
||||
.background(.quaternary, in: .capsule)
|
||||
}
|
||||
|
||||
if items.count < AppModel.bandLimit, !available.isEmpty {
|
||||
Menu {
|
||||
ForEach(available, id: \.self) { candidate in
|
||||
Button { items.append(candidate) } label: {
|
||||
Text(candidate.localizedName)
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "plus")
|
||||
}
|
||||
.menuStyle(.borderlessButton)
|
||||
.menuIndicator(.hidden)
|
||||
.fixedSize()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user