diff --git a/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ModuleListView+macOS.swift b/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ModuleListView+macOS.swift index ff9a7484..56556876 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ModuleListView+macOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ModuleListView+macOS.swift @@ -59,6 +59,7 @@ struct ModuleListView: View, Routable { } header: { if !profileEditor.modules.isEmpty { Text(Strings.Global.modules) + .themeTip(Strings.Views.Profile.ModuleList.Section.footer, edge: .bottom) } } } diff --git a/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ProfileGeneralView+macOS.swift b/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ProfileGeneralView+macOS.swift index 11311ae1..7132fc15 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ProfileGeneralView+macOS.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Profile/macOS/ProfileGeneralView+macOS.swift @@ -38,8 +38,6 @@ struct ProfileGeneralView: View { name: $profileEditor.name, placeholder: Strings.Placeholders.Profile.name ) - EmptyView() - .themeSection(footer: Strings.Views.Profile.ModuleList.Section.footer) StorageSection( uuid: profileEditor.id ) diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift index 153b42b6..1dbf1b14 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift @@ -50,6 +50,7 @@ extension Theme { case share case show case sleeping + case tip case tunnelDisable case tunnelEnable case tunnelRestart diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift index eb2cca29..34be1d46 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift @@ -273,6 +273,37 @@ struct ThemeLockScreenModifier: ViewModifier { } } +struct ThemeTipModifier: ViewModifier { + let text: String + + let edge: Edge + + @State + private var isPresenting = false + + func body(content: Content) -> some View { + HStack { + content + Button { + isPresenting = true + } label: { + ThemeImage(.tip) + } + .buttonStyle(.borderless) + } + .popover(isPresented: $isPresenting, arrowEdge: edge) { + VStack { + Text(text) + .foregroundStyle(.primary) + .lineLimit(nil) + .multilineTextAlignment(.leading) + .frame(width: 150.0) + } + .padding(12) + } + } +} + // MARK: - Views public enum ThemeAnimationCategory: CaseIterable { diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift index 96fb442f..0a2e05b2 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift @@ -101,6 +101,7 @@ public final class Theme: ObservableObject { case .share: return "square.and.arrow.up" case .show: return "eye" case .sleeping: return "powersleep" + case .tip: return "questionmark.circle" case .tunnelDisable: return "arrow.down" case .tunnelEnable: return "arrow.up" case .tunnelRestart: return "arrow.clockwise" @@ -208,6 +209,10 @@ extension View { public func themeLockScreen() -> some View { modifier(ThemeLockScreenModifier()) } + + public func themeTip(_ text: String, edge: Edge) -> some View { + modifier(ThemeTipModifier(text: text, edge: edge)) + } } // MARK: - Views