Convert Appearance settings to macOS-native helpers

This commit is contained in:
Arkadiusz Fal
2026-04-20 23:21:13 +02:00
parent 14b874022b
commit bb8fb28998

View File

@@ -11,7 +11,7 @@ struct AppearanceSettingsView: View {
@Environment(\.appEnvironment) private var appEnvironment @Environment(\.appEnvironment) private var appEnvironment
var body: some View { var body: some View {
Form { SettingsFormContainer {
if let settings = appEnvironment?.settingsManager { if let settings = appEnvironment?.settingsManager {
// Theme section // Theme section
#if !os(tvOS) #if !os(tvOS)
@@ -52,7 +52,7 @@ private struct ThemeSection: View {
@Bindable var settings: SettingsManager @Bindable var settings: SettingsManager
var body: some View { var body: some View {
Section(String(localized: "settings.appearance.theme.header")) { SettingsFormSection("settings.appearance.theme.header") {
Picker( Picker(
String(localized: "settings.appearance.theme"), String(localized: "settings.appearance.theme"),
selection: $settings.theme selection: $settings.theme
@@ -73,7 +73,7 @@ private struct AppIconSection: View {
@Bindable var settings: SettingsManager @Bindable var settings: SettingsManager
var body: some View { var body: some View {
Section(String(localized: "settings.appearance.appIcon.header")) { SettingsFormSection("settings.appearance.appIcon.header") {
NavigationLink { NavigationLink {
AppIconPickerView(settings: settings) AppIconPickerView(settings: settings)
} label: { } label: {
@@ -144,7 +144,7 @@ private struct AccentColorSection: View {
@Bindable var settings: SettingsManager @Bindable var settings: SettingsManager
var body: some View { var body: some View {
Section(String(localized: "settings.appearance.accentColor.header")) { SettingsFormSection("settings.appearance.accentColor.header") {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 50))], spacing: 16) { LazyVGrid(columns: [GridItem(.adaptive(minimum: 50))], spacing: 16) {
ForEach(AccentColor.allCases, id: \.self) { accentColor in ForEach(AccentColor.allCases, id: \.self) { accentColor in
AccentColorButton( AccentColorButton(
@@ -165,7 +165,7 @@ private struct ListStyleSection: View {
@Bindable var settings: SettingsManager @Bindable var settings: SettingsManager
var body: some View { var body: some View {
Section { SettingsFormSection("settings.appearance.listStyle.header") {
Picker(selection: $settings.listStyle) { Picker(selection: $settings.listStyle) {
ForEach(VideoListStyle.allCases, id: \.self) { style in ForEach(VideoListStyle.allCases, id: \.self) { style in
Text(style.displayName).tag(style) Text(style.displayName).tag(style)
@@ -173,8 +173,6 @@ private struct ListStyleSection: View {
} label: { } label: {
Label(String(localized: "settings.appearance.listStyle"), systemImage: "list.bullet") Label(String(localized: "settings.appearance.listStyle"), systemImage: "list.bullet")
} }
} header: {
Text(String(localized: "settings.appearance.listStyle.header"))
} }
} }
} }
@@ -185,13 +183,11 @@ private struct ThumbnailSection: View {
@Bindable var settings: SettingsManager @Bindable var settings: SettingsManager
var body: some View { var body: some View {
Section { SettingsFormSection("settings.appearance.thumbnails.header") {
Toggle(isOn: $settings.showWatchedCheckmark) { Toggle(isOn: $settings.showWatchedCheckmark) {
Label(String(localized: "settings.appearance.showWatchedCheckmark"), Label(String(localized: "settings.appearance.showWatchedCheckmark"),
systemImage: "checkmark.circle.fill") systemImage: "checkmark.circle.fill")
} }
} header: {
Text(String(localized: "settings.appearance.thumbnails.header"))
} }
} }
} }