mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 19:05:03 +00:00
Polish tvOS playlist sheets for focus and narrow layout
This commit is contained in:
@@ -136,31 +136,12 @@ struct PlaylistFormSheet: View {
|
|||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
private var tvOSContent: some View {
|
private var tvOSContent: some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
// Header
|
|
||||||
HStack {
|
|
||||||
Button(String(localized: "common.cancel")) {
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
.buttonStyle(TVToolbarButtonStyle())
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
Text(navigationTitle)
|
Text(navigationTitle)
|
||||||
.font(.title2)
|
.font(.title3)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
.lineLimit(1)
|
||||||
|
.padding(.top, 16)
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
Button(saveButtonTitle) {
|
|
||||||
save()
|
|
||||||
}
|
|
||||||
.buttonStyle(TVToolbarButtonStyle())
|
|
||||||
.disabled(!canSave)
|
|
||||||
}
|
|
||||||
.padding(.horizontal, 48)
|
|
||||||
.padding(.vertical, 24)
|
|
||||||
|
|
||||||
// Form
|
|
||||||
Form {
|
Form {
|
||||||
Section {
|
Section {
|
||||||
TVSettingsTextField(
|
TVSettingsTextField(
|
||||||
@@ -187,7 +168,21 @@ struct PlaylistFormSheet: View {
|
|||||||
}
|
}
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
Button(saveButtonTitle) {
|
||||||
|
save()
|
||||||
}
|
}
|
||||||
|
.buttonStyle(TVToolbarButtonStyle())
|
||||||
|
.lineLimit(1)
|
||||||
|
.disabled(!canSave)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .center)
|
||||||
|
.listRowBackground(Color.clear)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scrollClipDisabled()
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.padding(.vertical, 16)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ struct PlaylistSelectorSheet: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if os(tvOS)
|
||||||
|
.scrollClipDisabled()
|
||||||
|
.padding(.horizontal, 40)
|
||||||
|
.padding(.vertical, 24)
|
||||||
|
#else
|
||||||
.navigationTitle(String(localized: "playlist.addTo"))
|
.navigationTitle(String(localized: "playlist.addTo"))
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
@@ -93,6 +98,7 @@ struct PlaylistSelectorSheet: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
.sheet(isPresented: $showingNewPlaylist) {
|
.sheet(isPresented: $showingNewPlaylist) {
|
||||||
PlaylistFormSheet(mode: .create) { title, description in
|
PlaylistFormSheet(mode: .create) { title, description in
|
||||||
pendingPlaylistTitle = title
|
pendingPlaylistTitle = title
|
||||||
|
|||||||
Reference in New Issue
Block a user