diff --git a/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift b/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift index 95dfb04..8ed1fc2 100644 --- a/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift +++ b/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift @@ -99,7 +99,25 @@ struct SettingsStore: Sendable, Codable, Hashable, Equatable, Identifiable { var showDockProgress: Bool // MARK: Color swatch - var colorSwatchSettings: ColorSwatchSettingsModel + /// Backing property for color swatch settings + private var _colorSwatchSettings: ColorSwatchSettingsModel + var colorSwatchSettings: ColorSwatchSettingsModel { + get { + // Disable swatch if export profile is excel + if self.unifiedExportProfile.extractProfile == .xlsx { + var copy = self._colorSwatchSettings + copy.enableSwatch = false + return copy + } else { + return self._colorSwatchSettings + } + } + + set { + self._colorSwatchSettings = newValue + } + } + /// Default settings public static func defaults() -> Self { @@ -144,7 +162,7 @@ struct SettingsStore: Sendable, Codable, Hashable, Equatable, Identifiable { roles: [], notificationFrequency: .onlyOnCompletion, showDockProgress: true, - colorSwatchSettings: .defaults() + _colorSwatchSettings: .defaults() ) } diff --git a/Source/Marker Data/Marker Data/Views/Detail Views/Image/SwatchSettingsView.swift b/Source/Marker Data/Marker Data/Views/Detail Views/Image/SwatchSettingsView.swift index 412f125..92884b8 100755 --- a/Source/Marker Data/Marker Data/Views/Detail Views/Image/SwatchSettingsView.swift +++ b/Source/Marker Data/Marker Data/Views/Detail Views/Image/SwatchSettingsView.swift @@ -13,6 +13,10 @@ struct SwatchSettingsView: View { @EnvironmentObject var settings: SettingsContainer var swatchDisabled: Bool { + if settings.store.unifiedExportProfile.extractProfile == .xlsx { + return true + } + let jsonProfiles: [ExportProfileFormat] = [.notion, .airtable] let isJSON = jsonProfiles.contains(settings.store.unifiedExportProfile.extractProfile) let isGIF = settings.store.imageMode == .GIF