Use native text Close button for sheet toolbars on macOS

Sheet dismiss buttons rendered as an iOS-style circular glass "X" on
macOS 26, which looks foreign on the desktop. Add a shared
sheetCloseToolbarItem helper that renders a native text "Close" button
on macOS while keeping the compact icon-only xmark on iOS/tvOS, and
replace the ~14 duplicated inline close buttons across sheets with it.
This commit is contained in:
Arkadiusz Fal
2026-05-24 12:34:53 +02:00
parent c245a0e2a0
commit 9568149c21
15 changed files with 64 additions and 121 deletions

View File

@@ -89,22 +89,7 @@ struct PlaylistSelectorSheet: View {
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
#if os(macOS)
ToolbarItem(placement: .cancellationAction) {
Button(String(localized: "common.close"), role: .cancel) {
dismiss()
}
}
#else
ToolbarItem(placement: .confirmationAction) {
Button(role: .cancel) {
dismiss()
} label: {
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}
#endif
sheetCloseToolbarItem { dismiss() }
}
#endif
.sheet(isPresented: $showingNewPlaylist) {

View File

@@ -1973,14 +1973,7 @@ struct VideoInfoView: View {
#endif
#if !os(tvOS)
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button(role: .cancel) {
showingCommentsSheet = false
} label: {
Label(String(localized: "common.close"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
}
sheetCloseToolbarItem { showingCommentsSheet = false }
}
#endif
}