mirror of
https://github.com/yattee/yattee.git
synced 2026-11-05 03:17:19 +00:00
Move comments pill mode into the comments page settings
The pill mode now lives on CommentsPageSettings and is edited in the comments page editor instead of a standalone settings section. The legacy value on PlayerPillSettings is kept for decoding old presets and migrated by effectivePanelSettings. Comments are loaded when either the comments page is enabled or the pill is not disabled.
This commit is contained in:
@@ -91,7 +91,6 @@ private struct PlayerControlsSettingsContent: View {
|
||||
)
|
||||
LayoutSectionsSection(viewModel: viewModel)
|
||||
#if os(iOS)
|
||||
CommentsPillSection(viewModel: viewModel)
|
||||
GesturesSectionsSection(viewModel: viewModel)
|
||||
#endif
|
||||
SystemControlsSection(viewModel: viewModel)
|
||||
@@ -426,39 +425,6 @@ private struct LayoutSectionsSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Comments Pill Section
|
||||
|
||||
private struct CommentsPillSection: View {
|
||||
@Bindable var viewModel: PlayerControlsSettingsViewModel
|
||||
|
||||
// Local state for immediate UI updates
|
||||
@State private var commentsPillMode: CommentsPillMode = .pill
|
||||
|
||||
var body: some View {
|
||||
Section {
|
||||
Picker(
|
||||
String(localized: "commentsPill.mode.title"),
|
||||
selection: $commentsPillMode
|
||||
) {
|
||||
ForEach(CommentsPillMode.allCases, id: \.self) { mode in
|
||||
Text(mode.displayName).tag(mode)
|
||||
}
|
||||
}
|
||||
.disabled(!viewModel.canEditActivePreset)
|
||||
.onChange(of: commentsPillMode) { _, newValue in
|
||||
guard newValue != viewModel.commentsPillMode else { return }
|
||||
viewModel.syncCommentsPillMode(newValue)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
commentsPillMode = viewModel.commentsPillMode
|
||||
}
|
||||
.onChange(of: viewModel.activePreset?.id) { _, _ in
|
||||
commentsPillMode = viewModel.commentsPillMode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Gestures Sections Section (iOS only)
|
||||
|
||||
#if os(iOS)
|
||||
|
||||
Reference in New Issue
Block a user