mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
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:
@@ -31,14 +31,7 @@ struct ChaptersView: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
}
|
||||
.task {
|
||||
await preloadChapterSheets()
|
||||
|
||||
@@ -114,14 +114,7 @@ struct ErrorDetailsSheet: View {
|
||||
#endif
|
||||
.toolbar {
|
||||
#if !os(tvOS)
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
|
||||
ToolbarItemGroup(placement: .primaryAction) {
|
||||
// Copy button
|
||||
|
||||
@@ -276,14 +276,7 @@ struct QualitySelectorView: View {
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
performDismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { performDismiss() }
|
||||
}
|
||||
#endif
|
||||
.navigationDestination(for: QualitySelectorDestination.self) { destination in
|
||||
|
||||
@@ -125,14 +125,7 @@ struct QueueManagementSheet: View {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
queueModeMenu
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
performDismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { performDismiss() }
|
||||
}
|
||||
}
|
||||
.presentationDragIndicator(.visible)
|
||||
|
||||
Reference in New Issue
Block a user