iOS dev 30: hide Duo swap, Library Layout in Settings, Settings width on Duo, centred stem faders, folded spacing, no folded header menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29a1742f8d
commit
150e47a305
8 files changed
+130
-84
No files matched your search
@@ -232,6 +232,7 @@ struct SettingsScreen: View {
|
||||
Section {
|
||||
NavCell(title: "Equalizer", value: !g.eq.state.enabled ? "Off" : g.eq.active?.name ?? "On", icon: "slider.vertical.3", iconBg: 0x34C759, route: .Eq)
|
||||
NavCell(title: "Appearance", value: s.theme.label, icon: "paintbrush.fill", iconBg: 0x007AFF, route: .Appearance)
|
||||
NavCell(title: "Library Layout", value: nil, icon: "books.vertical.fill", iconBg: 0xFF9F0A, route: .LibraryLayout)
|
||||
} header: { Header(text: "Sound and look") }
|
||||
Section {
|
||||
StepperCell(title: "Cache Ahead", value: $s.precacheCount, icon: "arrow.down.to.line", iconBg: 0xFF9500)
|
||||
@@ -282,6 +283,45 @@ struct SettingsScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- library layout -------------------------------------------------------------------------
|
||||
|
||||
/// The Library tab's section order and which sections show, plus the order of its station and
|
||||
/// browse rows. Always in edit mode, so the drag handles are right there.
|
||||
struct LibraryLayoutScreen: View {
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let s = g.settings
|
||||
let off = LibraryHome.hidden(s)
|
||||
List {
|
||||
Section {
|
||||
ForEach(LibraryHome.ordered(LibraryHome.sectionNames, s) { $0 }, id: \.self) { name in
|
||||
Toggle(name, isOn: Binding(get: { !off.contains(name) }, set: { _ in LibraryHome.toggle(name, s) }))
|
||||
.themedRow()
|
||||
}
|
||||
.onMove { LibraryHome.reorder(LibraryHome.sectionNames, from: $0, to: $1, s) }
|
||||
} header: { Header(text: "Sections") } footer: {
|
||||
Footer(text: "Drag to reorder. Switch a section off to hide it from Library.")
|
||||
}
|
||||
rows("Stations", LibraryHome.stationNames, s)
|
||||
rows("Browse", LibraryHome.browseNames, s)
|
||||
}
|
||||
.listStyle(.insetGrouped)
|
||||
.listSectionSpacing(22)
|
||||
.environment(\.editMode, .constant(.active))
|
||||
.themedList()
|
||||
.navigationTitle("Library Layout")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
|
||||
private func rows(_ title: String, _ names: [String], _ s: Settings) -> some View {
|
||||
Section {
|
||||
ForEach(LibraryHome.ordered(names, s) { $0 }, id: \.self) { Text($0).themedRow() }
|
||||
.onMove { LibraryHome.reorder(names, from: $0, to: $1, s) }
|
||||
} header: { Header(text: title) }
|
||||
}
|
||||
}
|
||||
|
||||
// ---- about ----------------------------------------------------------------------------------
|
||||
|
||||
private struct Maintainer: Identifiable {
|
||||
|
||||
Reference in new issue
Block a user