mirror of
https://github.com/yattee/yattee.git
synced 2025-04-28 07:50:33 +05:30
Inspector and other layouts fixes
This commit is contained in:
parent
4ee1383f3a
commit
e58afcbf3f
@ -18,6 +18,8 @@ struct RelatedView: View {
|
||||
VideoContextMenuView(video: video)
|
||||
}
|
||||
}
|
||||
Color.clear.padding(.bottom, 50)
|
||||
.listRowBackground(Color.clear)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ struct CommentsView: View {
|
||||
if embedInScrollView {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
commentsStack
|
||||
Color.clear.frame(height: 50)
|
||||
}
|
||||
} else {
|
||||
commentsStack
|
||||
|
@ -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,27 +36,38 @@ struct InspectorView: View {
|
||||
}
|
||||
}
|
||||
|
||||
if video.localStream != nil || video.localStreamFileExtension != nil {
|
||||
videoDetailGroupHeading("File")
|
||||
}
|
||||
VStack(spacing: 4) {
|
||||
if video.localStream != nil || video.localStreamFileExtension != nil {
|
||||
videoDetailGroupHeading("File", image: "doc")
|
||||
}
|
||||
|
||||
if let fileExtension = video.localStreamFileExtension {
|
||||
videoDetailRow("File Extension", value: fileExtension)
|
||||
}
|
||||
if let fileExtension = video.localStreamFileExtension {
|
||||
videoDetailRow("File Extension", value: fileExtension)
|
||||
}
|
||||
|
||||
if let url = video.localStream?.localURL, video.localStreamIsRemoteURL {
|
||||
videoDetailRow("URL", value: url.absoluteString)
|
||||
if let url = video.localStream?.localURL, video.localStreamIsRemoteURL {
|
||||
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 {
|
||||
Text(heading.uppercased())
|
||||
.font(.footnote)
|
||||
.foregroundColor(.secondary)
|
||||
@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)
|
||||
}
|
||||
|
||||
@ViewBuilder func videoDetailRow(_ detail: String, value: String) -> some View {
|
||||
@ -81,5 +92,6 @@ struct InspectorView: View {
|
||||
struct InspectorView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
InspectorView(video: .fixture)
|
||||
.injectFixtureEnvironmentObjects()
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user