Video details toolbar and inspector settings

This commit is contained in:
Arkadiusz Fal
2022-11-13 23:36:46 +01:00
parent 7cc3cd950b
commit 041a28e7a0
8 changed files with 97 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import Defaults
import SwiftUI
struct VideoDetailsToolbar: View {
static let lowOpacity = 0.33
static let lowOpacity = 0.5
var video: Video?
@Binding var page: VideoDetails.DetailsPage
var sidebarQueue: Bool
@@ -123,6 +123,7 @@ struct VideoDetailsToolbar: View {
{
Text(tool.wrappedValue.name)
.font(.system(size: 14).bold())
.padding(.trailing, 4)
.foregroundColor(.white)
.allowsTightening(true)
.lineLimit(1)
@@ -136,7 +137,18 @@ struct VideoDetailsToolbar: View {
)
}
var visibleToolsCount: Int {
tools.filter { $0.isAvailable(for: video, sidebarQueue: sidebarQueue) }.count
}
var activeToolID: VideoDetailsTool.ID {
activeTool?.id ?? "queue"
}
}
struct VideoDetailsToolbar_Previews: PreviewProvider {
static var previews: some View {
VideoDetailsToolbar(page: .constant(.queue), sidebarQueue: false)
.injectFixtureEnvironmentObjects()
}
}