diff --git a/Sources/FioriSwiftUICore/Components/CancellableResettableForm.swift b/Sources/FioriSwiftUICore/Components/CancellableResettableForm.swift index 57db660ef..b38ba4049 100644 --- a/Sources/FioriSwiftUICore/Components/CancellableResettableForm.swift +++ b/Sources/FioriSwiftUICore/Components/CancellableResettableForm.swift @@ -34,12 +34,20 @@ struct CancellableResettableDialogForm AnyView } +#if !os(visionOS) + public let DefaultOptionListPickerForegroundColor = Color.preferredColor(.tintColor) +#else + public let DefaultOptionListPickerForegroundColor = Color.preferredColor(.primaryLabel) +#endif + /// Default option list picker style public struct DefaultOptionListPickerStyle: OptionListPickerStyle { let font: Font @@ -68,7 +74,7 @@ public struct DefaultOptionListPickerStyle: OptionListPickerStyle { let minTouchHeight: CGFloat /// :nodoc: - public init(font: Font = .system(.body), foregroundColorSelected: Color = .preferredColor(.tintColor), foregroundColorUnselected: Color = .preferredColor(.tertiaryLabel), fillColorSelected: Color = .preferredColor(.secondaryGroupedBackground), fillColorUnselected: Color = .preferredColor(.tertiaryFill), strokeColorSelected: Color = .preferredColor(.tintColor), strokeColorUnselected: Color = .preferredColor(.separator), cornerRadius: CGFloat = 16, spacing: CGFloat = 4, borderWidth: CGFloat = 1, minHeight: CGFloat = 44, minTouchHeight: CGFloat = 50) { + public init(font: Font = .system(.body), foregroundColorSelected: Color = DefaultOptionListPickerForegroundColor, foregroundColorUnselected: Color = .preferredColor(.tertiaryLabel), fillColorSelected: Color = .preferredColor(.secondaryGroupedBackground), fillColorUnselected: Color = .preferredColor(.tertiaryFill), strokeColorSelected: Color = DefaultOptionListPickerForegroundColor, strokeColorUnselected: Color = .preferredColor(.separator), cornerRadius: CGFloat = 16, spacing: CGFloat = 4, borderWidth: CGFloat = 1, minHeight: CGFloat = 44, minTouchHeight: CGFloat = 50) { self.font = font self.foregroundColorSelected = foregroundColorSelected self.foregroundColorUnselected = foregroundColorUnselected diff --git a/Sources/FioriSwiftUICore/Views/SearchListPickerItem+View.swift b/Sources/FioriSwiftUICore/Views/SearchListPickerItem+View.swift index 53facd70a..c92e7afe0 100644 --- a/Sources/FioriSwiftUICore/Views/SearchListPickerItem+View.swift +++ b/Sources/FioriSwiftUICore/Views/SearchListPickerItem+View.swift @@ -45,7 +45,11 @@ extension SearchListPickerItem: View { Spacer() if isSelected { Image(systemName: "checkmark") - .foregroundColor(.preferredColor(UIDevice.current.userInterfaceIdiom != .vision ? .tintColor : .primaryLabel)) + #if !os(visionOS) + .foregroundStyle(Color.preferredColor(.tintColor)) + #else + .foregroundStyle(Color.preferredColor(.primaryLabel)) + #endif } } .padding(0) diff --git a/Sources/FioriSwiftUICore/Views/SortFilter/FilterFeedbackBarItem+Style.swift b/Sources/FioriSwiftUICore/Views/SortFilter/FilterFeedbackBarItem+Style.swift index eb24a8d98..216021cbe 100644 --- a/Sources/FioriSwiftUICore/Views/SortFilter/FilterFeedbackBarItem+Style.swift +++ b/Sources/FioriSwiftUICore/Views/SortFilter/FilterFeedbackBarItem+Style.swift @@ -24,6 +24,12 @@ public protocol FilterFeedbackBarStyle { func makeBody(configuration: Self.Configuration) -> AnyView } +#if !os(visionOS) + public let DefaultFilterFeedbackBarForegroundColor = Color.preferredColor(.tintColor) +#else + public let DefaultFilterFeedbackBarForegroundColor = Color.preferredColor(.primaryLabel) +#endif + /// Default style for sort and filer menu item public struct DefaultFilterFeedbackBarStyle: FilterFeedbackBarStyle { let font: Font @@ -40,7 +46,7 @@ public struct DefaultFilterFeedbackBarStyle: FilterFeedbackBarStyle { let minHeight: CGFloat /// :nodoc: - public init(font: Font = .system(.body), foregroundColorSelected: Color = (UIDevice.current.userInterfaceIdiom != .vision ? .preferredColor(.tintColor) : .preferredColor(.primaryLabel)), foregroundColorUnselected: Color = .preferredColor(.tertiaryLabel), fillColorSelected: Color = Color.clear, fillColorUnselected: Color = .preferredColor(.tertiaryFill), strokeColorSelected: Color = (UIDevice.current.userInterfaceIdiom != .vision ? .preferredColor(.tintColor) : .preferredColor(.primaryLabel)), strokeColorUnselected: Color = .preferredColor(.separator), cornerRadius: CGFloat = 10, spacing: CGFloat = 6, padding: CGFloat = 8, borderWidth: CGFloat = 1, minHeight: CGFloat = 38) { + public init(font: Font = .system(.body), foregroundColorSelected: Color = DefaultFilterFeedbackBarForegroundColor, foregroundColorUnselected: Color = .preferredColor(.tertiaryLabel), fillColorSelected: Color = Color.clear, fillColorUnselected: Color = .preferredColor(.tertiaryFill), strokeColorSelected: Color = DefaultFilterFeedbackBarForegroundColor, strokeColorUnselected: Color = .preferredColor(.separator), cornerRadius: CGFloat = 10, spacing: CGFloat = 6, padding: CGFloat = 8, borderWidth: CGFloat = 1, minHeight: CGFloat = 38) { self.font = font self.foregroundColorSelected = foregroundColorSelected self.foregroundColorUnselected = foregroundColorUnselected