Show queue mode label and split bottom bar on macOS

On macOS the queue sheet's mode selector now shows both icon and text
and shares a single bottom toolbar bar with the Close button, pinned to
opposite edges.
This commit is contained in:
Arkadiusz Fal
2026-06-29 23:42:30 +02:00
parent daf5fe1ad1
commit 403b83badc

View File

@@ -122,11 +122,35 @@ struct QueueManagementSheet: View {
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
#if !os(macOS)
ToolbarItem(placement: .cancellationAction) {
queueModeMenu
}
sheetCloseToolbarItem { performDismiss() }
#endif
}
#if os(macOS)
// On macOS the mode selector and Close button share one bottom bar,
// with the mode selector pinned to the leading edge so it can show
// both icon and text.
.safeAreaInset(edge: .bottom) {
VStack(spacing: 0) {
Divider()
HStack {
queueModeMenu
Spacer()
Button(role: .cancel) { performDismiss() } label: {
Text(String(localized: "common.close"))
}
.keyboardShortcut(.cancelAction)
.buttonStyle(.borderedProminent)
}
.padding(.horizontal, 16)
.padding(.vertical, 10)
}
.background(.bar)
}
#endif
}
.presentationDragIndicator(.visible)
#if os(iOS)
@@ -459,11 +483,20 @@ struct QueueManagementSheet: View {
} label: {
HStack(spacing: 4) {
Image(systemName: playerState?.queueMode.icon ?? "list.bullet")
#if os(macOS)
Text(playerState?.queueMode.displayName ?? QueueMode.normal.displayName)
#endif
Image(systemName: "chevron.down")
.font(.caption2)
}
.foregroundStyle(.tint)
}
#if os(macOS)
// Default Menu style stretches full-width on macOS; keep the button
// hugging its label so it sits tidily in the bottom-left bar.
.menuStyle(.borderlessButton)
.fixedSize()
#endif
#endif
}