aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Preferences/TemplatesPreferencesView.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-07 13:09:13 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-07 13:09:13 +0200
commit3fdaeab6a7fa19b0c5424de487efc37c0994c86e (patch)
tree09af4c1d54924350b4e6c89fb4f284170e89b945 /Map/Presentation/Preferences/TemplatesPreferencesView.swift
parent933078c10e99002c8a5f647e476819f0f1706a14 (diff)
More localization and map preferences
Diffstat (limited to 'Map/Presentation/Preferences/TemplatesPreferencesView.swift')
-rw-r--r--Map/Presentation/Preferences/TemplatesPreferencesView.swift55
1 files changed, 31 insertions, 24 deletions
diff --git a/Map/Presentation/Preferences/TemplatesPreferencesView.swift b/Map/Presentation/Preferences/TemplatesPreferencesView.swift
index 92b9b09..2b70b67 100644
--- a/Map/Presentation/Preferences/TemplatesPreferencesView.swift
+++ b/Map/Presentation/Preferences/TemplatesPreferencesView.swift
@@ -41,6 +41,7 @@ struct TemplatesPreferencesView: View {
@State private var selectedTemplate: Template?
@State private var showingAddSheet = false
@State private var newTemplateName = ""
+ @State private var showingHelpPopover = false
private var templates: Binding<[Template]> {
Binding(
@@ -80,15 +81,6 @@ struct TemplatesPreferencesView: View {
var body: some View {
VStack(alignment: .leading, spacing: Dimensions.Spacing.regular) {
- Text("preferences.templates.title")
- .font(.Theme.Title.emphasized)
- .lineSpacing(Dimensions.LineHeight.title - Dimensions.FontSize.title)
- Text("preferences.templates.explanation")
- .font(.Theme.Body.regular)
- .kerning(Dimensions.Kerning.body)
- .lineSpacing(Dimensions.LineHeight.body - Dimensions.FontSize.body)
- .padding(.top, Dimensions.Spacing.loose)
- .padding(.bottom, Dimensions.Spacing.regular)
HStack(spacing: Dimensions.Spacing.cozy) {
VStack(alignment: .leading, spacing: Dimensions.Spacing.regular) {
List(templates.wrappedValue) { template in
@@ -135,24 +127,39 @@ struct TemplatesPreferencesView: View {
.listStyle(.plain)
.border(Color.Theme.UI.foreground.opacity(0.2), width: 1)
- HStack(spacing: Dimensions.Spacing.coziest) {
-
+ HStack(spacing: Dimensions.Spacing.regular) {
+
Spacer()
-
- Button(action: { showingAddSheet = true }) {
- Image(systemName: "plus")
+
+ Button(action: { showingHelpPopover = true }) {
+ Image(systemName: "questionmark.circle")
}
- .keyboardShortcut("t", modifiers: [.command])
- .help("preferences.templates.help.add")
-
- Button(action: {
- removeTemplate(selectedTemplate)
- }) {
- Image(systemName: "minus")
+ .buttonStyle(.borderless)
+ .popover(isPresented: $showingHelpPopover, arrowEdge: .bottom) {
+ Text("preferences.templates.explanation")
+ .font(.Theme.Body.regular)
+ .kerning(Dimensions.Kerning.body)
+ .lineSpacing(Dimensions.LineHeight.body - Dimensions.FontSize.body)
+ .frame(width: 300)
+ .padding(Dimensions.Spacing.regular)
+ }
+
+ HStack(spacing: Dimensions.Spacing.coziest) {
+ Button(action: { showingAddSheet = true }) {
+ Image(systemName: "plus")
+ }
+ .keyboardShortcut("t", modifiers: [.command])
+ .help("preferences.templates.help.add")
+
+ Button(action: {
+ removeTemplate(selectedTemplate)
+ }) {
+ Image(systemName: "minus")
+ }
+ .keyboardShortcut(.delete, modifiers: [.command])
+ .help("preferences.templates.help.remove \(selectedTemplate?.name ?? "")")
+ .disabled(selectedTemplate == nil)
}
- .keyboardShortcut(.delete, modifiers: [.command])
- .help("preferences.templates.help.remove \(selectedTemplate?.name ?? "")")
- .disabled(selectedTemplate == nil)
}
}
.frame(width: Dimensions.Preferences.Sidebar.width)