From b37baa07c27fd78be3ce81fb9002c846e7970ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mil=C3=A1n=20V=C3=A1rady?= Date: Sun, 22 Mar 2026 21:43:13 +0100 Subject: [PATCH] Disable swatch when using excel profile --- .../Models/Settings/SettingsStore.swift | 22 +++++++++++++++++-- .../Image/SwatchSettingsView.swift | 4 ++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift b/Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift index 95dfb049..8ed1fc25 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 412f1253..92884b8b 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