mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Fix Add to Playlist sheet layout on macOS
The sheet collapsed to an empty strip because a List inside a sheet has no intrinsic height on macOS. Add an explicit minimum frame like other sheets, gate presentationDetents to iOS, and replace the prominent xmark toolbar button with a native Close button on macOS.
This commit is contained in:
@@ -89,6 +89,13 @@ 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()
|
||||
@@ -97,6 +104,7 @@ struct PlaylistSelectorSheet: View {
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
.sheet(isPresented: $showingNewPlaylist) {
|
||||
@@ -114,7 +122,12 @@ struct PlaylistSelectorSheet: View {
|
||||
loadPlaylists()
|
||||
}
|
||||
}
|
||||
#if os(iOS)
|
||||
.presentationDetents([.medium, .large])
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.frame(minWidth: 450, minHeight: 500)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func loadPlaylists() {
|
||||
|
||||
Reference in New Issue
Block a user