diff options
Diffstat (limited to 'Map/Presentation/Preferences/TemplatesPreferencesView.swift')
| -rw-r--r-- | Map/Presentation/Preferences/TemplatesPreferencesView.swift | 55 |
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) |