mirror of
https://github.com/yattee/yattee.git
synced 2026-06-27 00:54:21 +00:00
Make Playback and Subtitles settings feel native on macOS
Add shared SettingsFormContainer/SettingsFormSection helpers that mirror the Sources screen styling (uppercase subheadline headers, divider- bracketed cards, ScrollView + LazyVStack) on macOS while keeping the standard Form/Section layout on iOS and tvOS. Convert PlaybackSettingsView and SubtitlesSettingsView to the new helpers, wrap the macOS Settings detail pane in a NavigationStack so NavigationLink pushes (Subtitles Appearance) render in the detail column, fold the macOS-only Player Mode + Auto-resize player controls into the Behavior section, and drop the unused queue footer.
This commit is contained in:
@@ -12,7 +12,7 @@ struct SubtitlesSettingsView: View {
|
||||
@State private var settings: SubtitleSettings = .default
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
SettingsFormContainer {
|
||||
fontSection
|
||||
colorsSection
|
||||
styleSection
|
||||
@@ -36,7 +36,7 @@ struct SubtitlesSettingsView: View {
|
||||
// MARK: - Font Section
|
||||
|
||||
private var fontSection: some View {
|
||||
Section {
|
||||
SettingsFormSection {
|
||||
PlatformMenuPicker(
|
||||
String(localized: "settings.subtitles.font"),
|
||||
selection: $settings.font
|
||||
@@ -84,7 +84,7 @@ struct SubtitlesSettingsView: View {
|
||||
// MARK: - Colors Section
|
||||
|
||||
private var colorsSection: some View {
|
||||
Section {
|
||||
SettingsFormSection("settings.subtitles.colorsSection") {
|
||||
#if os(tvOS)
|
||||
HStack {
|
||||
Text(String(localized: "settings.subtitles.textColor"))
|
||||
@@ -175,15 +175,13 @@ struct SubtitlesSettingsView: View {
|
||||
)
|
||||
}
|
||||
#endif
|
||||
} header: {
|
||||
Text(String(localized: "settings.subtitles.colorsSection"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Style Section
|
||||
|
||||
private var styleSection: some View {
|
||||
Section {
|
||||
SettingsFormSection("settings.subtitles.styleSection") {
|
||||
Toggle(
|
||||
String(localized: "settings.subtitles.bold"),
|
||||
isOn: $settings.isBold
|
||||
@@ -195,15 +193,13 @@ struct SubtitlesSettingsView: View {
|
||||
isOn: $settings.isItalic
|
||||
)
|
||||
.onChange(of: settings.isItalic) { _, _ in saveSettings() }
|
||||
} header: {
|
||||
Text(String(localized: "settings.subtitles.styleSection"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Position Section
|
||||
|
||||
private var positionSection: some View {
|
||||
Section {
|
||||
SettingsFormSection("settings.subtitles.positionSection", footer: "settings.subtitles.positionFooter") {
|
||||
#if os(tvOS)
|
||||
LabeledContent(
|
||||
String(localized: "settings.subtitles.positionSection"),
|
||||
@@ -218,17 +214,13 @@ struct SubtitlesSettingsView: View {
|
||||
)
|
||||
.onChange(of: settings.bottomMargin) { _, _ in saveSettings() }
|
||||
#endif
|
||||
} header: {
|
||||
Text(String(localized: "settings.subtitles.positionSection"))
|
||||
} footer: {
|
||||
Text(String(localized: "settings.subtitles.positionFooter"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Reset Section
|
||||
|
||||
private var resetSection: some View {
|
||||
Section {
|
||||
SettingsFormSection {
|
||||
Button(role: .destructive) {
|
||||
settings = .default
|
||||
saveSettings()
|
||||
|
||||
Reference in New Issue
Block a user