Add tag overview, improve assets

This commit is contained in:
Christoph Hagen
2024-12-15 21:20:12 +01:00
parent 8a3a0f1797
commit 1e67a99866
59 changed files with 1301 additions and 480 deletions

View File

@@ -1,4 +1,5 @@
import SwiftUI
import SFSafeSymbols
struct NavigationBarSettingsView: View {
@@ -9,7 +10,7 @@ struct NavigationBarSettingsView: View {
private var content: Content
@State
private var showTagPicker = false
private var showItemPicker = false
var body: some View {
ScrollView {
@@ -21,14 +22,10 @@ struct NavigationBarSettingsView: View {
.foregroundStyle(.secondary)
.padding(.bottom, 30)
Text("Visible Tags")
.font(.headline)
FlowHStack {
ForEach(content.settings.navigationTags) { tag in
TagView(text: tag.localized(in: language).name)
.foregroundStyle(.white)
}
Button(action: { showTagPicker = true }) {
HStack {
Text("Links")
.font(.headline)
Button(action: { showItemPicker = true }) {
Image(systemSymbol: .squareAndPencilCircleFill)
.resizable()
.aspectRatio(1, contentMode: .fit)
@@ -40,15 +37,19 @@ struct NavigationBarSettingsView: View {
}
.buttonStyle(.plain)
}
ForEach(content.settings.navigationItems) { tag in
TagView(text: tag.title(in: language))
.foregroundStyle(.white)
}
Text("Select the tags to show in the navigation bar. The number should be even.")
.foregroundStyle(.secondary)
}
}
.sheet(isPresented: $showTagPicker) {
TagSelectionView(
presented: $showTagPicker,
selected: $content.settings.navigationTags,
tags: $content.tags)
.sheet(isPresented: $showItemPicker) {
ItemSelectionView(
isPresented: $showItemPicker,
selectedItems: $content.settings.navigationItems)
}
}
}