diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift index 4eabee39..6e8b43f6 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+ImageName.swift @@ -62,3 +62,45 @@ extension Theme { case tunnelUninstall } } + +extension Theme.ImageName { + static var defaultSystemName: (Self) -> String { + { + switch $0 { + case .add: return "plus" + case .close: return "xmark" + case .cloud: return "icloud" + case .contextDuplicate: return "plus.square.on.square" + case .contextRemove: return "trash" + case .copy: return "doc.on.doc" + case .disclose: return "chevron.down" + case .editableSectionEdit: return "arrow.up.arrow.down" + case .editableSectionRemove: return "trash" + case .favoriteOff: return "star" + case .favoriteOn: return "star.fill" + case .filters: return "line.3.horizontal.decrease" + case .footerAdd: return "plus.circle" + case .hide: return "eye.slash" + case .info: return "info.circle" + case .marked: return "checkmark" + case .moreDetails: return "ellipsis.circle" + case .pending: return "clock" + case .profileEdit: return "square.and.pencil" + case .profileImport: return "square.and.arrow.down" + case .profilesGrid: return "square.grid.2x2" + case .profilesList: return "rectangle.grid.1x2" + case .remove: return "minus" + case .settings: return "gearshape" + 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" + case .tunnelToggle: return "power" + case .tunnelUninstall: return "arrow.uturn.down" + } + } + } +} diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift index dccf688f..8c17e3bb 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme+UI.swift @@ -387,7 +387,7 @@ struct ThemeImage: View { } var body: some View { - Image(systemName: theme.systemImage(name)) + Image(systemName: theme.systemImageName(name)) } } diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift index 14584e54..e5b3b66c 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift @@ -78,43 +78,7 @@ public final class Theme: ObservableObject { var logoImage = "Logo" - var systemImage: (ImageName) -> String = { - switch $0 { - case .add: return "plus" - case .close: return "xmark" - case .cloud: return "icloud" - case .contextDuplicate: return "plus.square.on.square" - case .contextRemove: return "trash" - case .copy: return "doc.on.doc" - case .disclose: return "chevron.down" - case .editableSectionEdit: return "arrow.up.arrow.down" - case .editableSectionRemove: return "trash" - case .favoriteOff: return "star" - case .favoriteOn: return "star.fill" - case .filters: return "line.3.horizontal.decrease" - case .footerAdd: return "plus.circle" - case .hide: return "eye.slash" - case .info: return "info.circle" - case .marked: return "checkmark" - case .moreDetails: return "ellipsis.circle" - case .pending: return "clock" - case .profileEdit: return "square.and.pencil" - case .profileImport: return "square.and.arrow.down" - case .profilesGrid: return "square.grid.2x2" - case .profilesList: return "rectangle.grid.1x2" - case .remove: return "minus" - case .settings: return "gearshape" - 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" - case .tunnelToggle: return "power" - case .tunnelUninstall: return "arrow.uturn.down" - } - } + var systemImageName: (ImageName) -> String = Theme.ImageName.defaultSystemName init(dummy: Void) { }