mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 05:02:53 +00:00
Give the tvOS New Playlist row air between icon and title
A tvOS Label sets its plus glyph nearly against the text at this size; the row spells the gap out with an HStack there, shared by the local and remote sections. Other platforms keep the plain Label.
This commit is contained in:
@@ -239,15 +239,28 @@ struct PlaylistSelectorSheet: View {
|
||||
|
||||
// MARK: - Sections
|
||||
|
||||
/// The "New Playlist" row's label. tvOS lays a `Label`'s icon nearly
|
||||
/// against its title at this size, so the gap is spelled out there.
|
||||
private var newPlaylistLabel: some View {
|
||||
#if os(tvOS)
|
||||
HStack(spacing: 20) {
|
||||
Image(systemName: "plus.circle")
|
||||
Text(String(localized: "playlist.new"))
|
||||
}
|
||||
#else
|
||||
Label(
|
||||
String(localized: "playlist.new"),
|
||||
systemImage: "plus.circle"
|
||||
)
|
||||
#endif
|
||||
}
|
||||
|
||||
private var localSection: some View {
|
||||
Section {
|
||||
Button {
|
||||
showingNewPlaylist = true
|
||||
} label: {
|
||||
Label(
|
||||
String(localized: "playlist.new"),
|
||||
systemImage: "plus.circle"
|
||||
)
|
||||
newPlaylistLabel
|
||||
}
|
||||
|
||||
if playlists.isEmpty {
|
||||
@@ -274,10 +287,7 @@ struct PlaylistSelectorSheet: View {
|
||||
Button {
|
||||
newRemotePlaylistAccount = account
|
||||
} label: {
|
||||
Label(
|
||||
String(localized: "playlist.new"),
|
||||
systemImage: "plus.circle"
|
||||
)
|
||||
newPlaylistLabel
|
||||
}
|
||||
|
||||
if let remotePlaylists = appEnvironment?.remotePlaylistsCache.playlists(for: account.id) {
|
||||
|
||||
Reference in New Issue
Block a user