mirror of
https://github.com/yattee/yattee.git
synced 2026-07-22 15:22:01 +00:00
Drive macOS player control bars from presets
Render the macOS control bar button row and top bar from the active preset's sections via a new MacOSControlsSectionRenderer, replacing the hardcoded QuickTime-style rows in MacOSControlBar. Add a keepOnTop button type and macOS-specific button availability lists, and adapt the player controls settings editors (preset editor, section editor, button configuration) for macOS. Also apply the preset font style to the control bar time labels, and update the built-in macOS Default preset order (queue before transport, fullscreen at the end), bumping builtInPresetsVersion to 7.
This commit is contained in:
@@ -36,7 +36,9 @@ struct ButtonConfigurationView: View {
|
||||
var body: some View {
|
||||
if let config = configuration {
|
||||
Form {
|
||||
// Visibility mode (all buttons)
|
||||
// Visibility mode (all buttons); portrait/wide modes have no
|
||||
// meaning on macOS, where every button is always shown.
|
||||
#if os(iOS)
|
||||
Section {
|
||||
Picker(
|
||||
String(localized: "settings.playerControls.visibility"),
|
||||
@@ -54,15 +56,26 @@ struct ButtonConfigurationView: View {
|
||||
} footer: {
|
||||
Text(String(localized: "settings.playerControls.visibilityFooter"))
|
||||
}
|
||||
#endif
|
||||
|
||||
// Type-specific settings
|
||||
if config.buttonType.hasSettings {
|
||||
typeSpecificSettings(for: config)
|
||||
}
|
||||
#if os(macOS)
|
||||
if !config.buttonType.hasSettings {
|
||||
Section {
|
||||
Text(String(localized: "settings.playerControls.noButtonSettings"))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.navigationTitle(config.buttonType.displayName)
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#elseif os(macOS)
|
||||
.formStyle(.grouped)
|
||||
#endif
|
||||
.onAppear {
|
||||
syncFromConfiguration(config)
|
||||
|
||||
Reference in New Issue
Block a user