mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 22:32: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:
@@ -64,14 +64,7 @@ struct AddSourceView: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
}
|
||||
.navigationDestination(isPresented: $navigateToWebDAV) {
|
||||
AddWebDAVView(
|
||||
|
||||
@@ -54,14 +54,7 @@ struct InstancePickerSheet: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
}
|
||||
}
|
||||
.presentationDetents([.medium, .large])
|
||||
|
||||
@@ -278,14 +278,7 @@ private struct LogEntryDetailView: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
}
|
||||
}
|
||||
.presentationDetents([.medium, .large])
|
||||
|
||||
@@ -215,14 +215,7 @@ struct PeerTubeInstancesExploreView: View {
|
||||
@ToolbarContentBuilder
|
||||
private var toolbarContent: some ToolbarContent {
|
||||
#if !os(tvOS)
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
#endif
|
||||
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
|
||||
@@ -187,14 +187,7 @@ struct TapGesturesSettingsView: View {
|
||||
|
||||
TapZoneActionPicker(position: position, action: binding)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
selectedZonePosition = nil
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
sheetCloseToolbarItem { selectedZonePosition = nil }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -328,15 +328,7 @@ struct SettingsView: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
if showCloseButton {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button(role: .cancel) {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label(String(localized: "common.close"), systemImage: "xmark")
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
.accessibilityIdentifier("settings.doneButton")
|
||||
}
|
||||
sheetCloseToolbarItem(identifier: "settings.doneButton") { dismiss() }
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier("settings.view")
|
||||
|
||||
Reference in New Issue
Block a user