1
0
mirror of https://github.com/yattee/yattee.git synced 2025-04-28 16:00:33 +05:30

Inspector and other layouts fixes

This commit is contained in:
Arkadiusz Fal 2022-11-13 21:52:29 +01:00
parent 4ee1383f3a
commit e58afcbf3f
5 changed files with 36 additions and 17 deletions

View File

@ -18,6 +18,8 @@ struct RelatedView: View {
VideoContextMenuView(video: video) VideoContextMenuView(video: video)
} }
} }
Color.clear.padding(.bottom, 50)
.listRowBackground(Color.clear)
} }
} }
} }

View File

@ -12,6 +12,8 @@ struct ChaptersView: View {
ForEach(chapters) { chapter in ForEach(chapters) { chapter in
ChapterView(chapter: chapter) ChapterView(chapter: chapter)
} }
Color.clear.frame(height: 50)
.listRowBackground(Color.clear)
} }
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
} }

View File

@ -29,6 +29,7 @@ struct CommentsView: View {
if embedInScrollView { if embedInScrollView {
ScrollView(.vertical, showsIndicators: false) { ScrollView(.vertical, showsIndicators: false) {
commentsStack commentsStack
Color.clear.frame(height: 50)
} }
} else { } else {
commentsStack commentsStack

View File

@ -7,11 +7,11 @@ struct InspectorView: View {
var body: some View { var body: some View {
ScrollView { ScrollView {
VStack(spacing: 4) { VStack(alignment: .leading, spacing: 12) {
if let video { if let video {
Group { VStack(spacing: 4) {
if player.activeBackend == .mpv, player.mpvBackend.videoFormat != "unknown" { if player.activeBackend == .mpv, player.mpvBackend.videoFormat != "unknown" {
videoDetailGroupHeading("Video") videoDetailGroupHeading("Video", image: "film")
videoDetailRow("Format", value: player.mpvBackend.videoFormat) videoDetailRow("Format", value: player.mpvBackend.videoFormat)
videoDetailRow("Codec", value: player.mpvBackend.videoCodec) videoDetailRow("Codec", value: player.mpvBackend.videoCodec)
@ -26,8 +26,8 @@ struct InspectorView: View {
} }
if player.activeBackend == .mpv, player.mpvBackend.audioFormat != "unknown" { if player.activeBackend == .mpv, player.mpvBackend.audioFormat != "unknown" {
Group { VStack(spacing: 4) {
videoDetailGroupHeading("Audio") videoDetailGroupHeading("Audio", image: "music.note")
videoDetailRow("Format", value: player.mpvBackend.audioFormat) videoDetailRow("Format", value: player.mpvBackend.audioFormat)
videoDetailRow("Codec", value: player.mpvBackend.audioCodec) videoDetailRow("Codec", value: player.mpvBackend.audioCodec)
videoDetailRow("Driver", value: player.mpvBackend.currentAo) videoDetailRow("Driver", value: player.mpvBackend.currentAo)
@ -36,8 +36,9 @@ struct InspectorView: View {
} }
} }
VStack(spacing: 4) {
if video.localStream != nil || video.localStreamFileExtension != nil { if video.localStream != nil || video.localStreamFileExtension != nil {
videoDetailGroupHeading("File") videoDetailGroupHeading("File", image: "doc")
} }
if let fileExtension = video.localStreamFileExtension { if let fileExtension = video.localStreamFileExtension {
@ -48,14 +49,24 @@ struct InspectorView: View {
videoDetailRow("URL", value: url.absoluteString) videoDetailRow("URL", value: url.absoluteString)
} }
} }
} else {
NoCommentsView(text: "Not playing", systemImage: "stop.circle.fill")
} }
} }
.padding(.top, 10)
.padding(.bottom, 50)
}
.padding(.horizontal) .padding(.horizontal)
} }
@ViewBuilder func videoDetailGroupHeading(_ heading: String) -> some View { @ViewBuilder func videoDetailGroupHeading(_ heading: String, image systemName: String? = nil) -> some View {
HStack {
if let systemName {
Image(systemName: systemName)
}
Text(heading.uppercased()) Text(heading.uppercased())
.font(.footnote) .font(.footnote)
}
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
@ -81,5 +92,6 @@ struct InspectorView: View {
struct InspectorView_Previews: PreviewProvider { struct InspectorView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
InspectorView(video: .fixture) InspectorView(video: .fixture)
.injectFixtureEnvironmentObjects()
} }
} }

View File

@ -32,6 +32,8 @@ struct PlayerQueueView: View {
.padding(.vertical, 5) .padding(.vertical, 5)
.listRowInsets(EdgeInsets()) .listRowInsets(EdgeInsets())
#endif #endif
Color.clear.padding(.bottom, 50)
.listRowBackground(Color.clear)
} }
#if os(macOS) #if os(macOS)
.listStyle(.inset) .listStyle(.inset)