mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Minor UI changes
This commit is contained in:
@@ -2,6 +2,7 @@ import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct ControlsOverlay: View {
|
||||
@EnvironmentObject<NetworkStateModel> private var networkState
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
@EnvironmentObject<PlayerControlsModel> private var model
|
||||
|
||||
@@ -165,7 +166,7 @@ struct ControlsOverlay: View {
|
||||
Text("hw decoder: \(player.mpvBackend.hwDecoder)")
|
||||
Text("dropped: \(player.mpvBackend.frameDropCount)")
|
||||
Text("video: \(String(format: "%.2ffps", player.mpvBackend.outputFps))")
|
||||
Text("buffering: \(String(format: "%.0f%%", player.mpvBackend.bufferingState))")
|
||||
Text("buffering: \(String(format: "%.0f%%", networkState.bufferingState))")
|
||||
Text("cache: \(String(format: "%.2fs", player.mpvBackend.cacheDuration))")
|
||||
}
|
||||
.mask(RoundedRectangle(cornerRadius: 3))
|
||||
|
@@ -6,7 +6,11 @@ struct NetworkState: View {
|
||||
|
||||
var body: some View {
|
||||
Buffering(state: model.fullStateText)
|
||||
.opacity(model.pausedForCache || player.isSeeking ? 1 : 0)
|
||||
.opacity(visible ? 1 : 0)
|
||||
}
|
||||
|
||||
var visible: Bool {
|
||||
player.isPlaying && (model.pausedForCache || player.isSeeking)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -23,8 +23,6 @@ struct PlayerControls: View {
|
||||
@FocusState private var focusedField: Field?
|
||||
#endif
|
||||
|
||||
@Default(.controlsBarInPlayer) private var controlsBarInPlayer
|
||||
|
||||
init(player: PlayerModel, thumbnails: ThumbnailsModel) {
|
||||
self.player = player
|
||||
self.thumbnails = thumbnails
|
||||
@@ -191,12 +189,13 @@ struct PlayerControls: View {
|
||||
HStack(spacing: 20) {
|
||||
#if !os(tvOS)
|
||||
fullscreenButton
|
||||
pipButton
|
||||
|
||||
#if os(iOS)
|
||||
pipButton
|
||||
#endif
|
||||
|
||||
Spacer()
|
||||
|
||||
button("overlay", systemImage: "info.circle") {}
|
||||
|
||||
button("settings", systemImage: "gearshape", active: model.presentingControlsOverlay) {
|
||||
withAnimation(Self.animation) {
|
||||
model.presentingControlsOverlay.toggle()
|
||||
|
Reference in New Issue
Block a user