Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions Source/Marker Data/Marker Data/Models/Settings/SettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -144,7 +162,7 @@ struct SettingsStore: Sendable, Codable, Hashable, Equatable, Identifiable {
roles: [],
notificationFrequency: .onlyOnCompletion,
showDockProgress: true,
colorSwatchSettings: .defaults()
_colorSwatchSettings: .defaults()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading