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)
}
}
Color.clear.padding(.bottom, 50)
.listRowBackground(Color.clear)
}
}
}

View File

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

View File

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

View File

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

View File

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