mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 14:52:03 +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)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
#endif
|
#endif
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
#if os(macOS)
|
||||||
|
ToolbarItem(placement: .cancellationAction) {
|
||||||
|
Button(String(localized: "common.close"), role: .cancel) {
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
ToolbarItem(placement: .confirmationAction) {
|
ToolbarItem(placement: .confirmationAction) {
|
||||||
Button(role: .cancel) {
|
Button(role: .cancel) {
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -97,6 +104,7 @@ struct PlaylistSelectorSheet: View {
|
|||||||
.labelStyle(.iconOnly)
|
.labelStyle(.iconOnly)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
.sheet(isPresented: $showingNewPlaylist) {
|
.sheet(isPresented: $showingNewPlaylist) {
|
||||||
@@ -114,7 +122,12 @@ struct PlaylistSelectorSheet: View {
|
|||||||
loadPlaylists()
|
loadPlaylists()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if os(iOS)
|
||||||
.presentationDetents([.medium, .large])
|
.presentationDetents([.medium, .large])
|
||||||
|
#endif
|
||||||
|
#if os(macOS)
|
||||||
|
.frame(minWidth: 450, minHeight: 500)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private func loadPlaylists() {
|
private func loadPlaylists() {
|
||||||
|
|||||||
Reference in New Issue
Block a user