feat: toolbar auto-hides after 60s of no interaction
This commit is contained in:
parent
2fd6db3a4e
commit
1fa6f6a4bb
@ -202,6 +202,11 @@ struct ControlToolbar: View {
|
|||||||
.padding(.horizontal, 16)
|
.padding(.horizontal, 16)
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
.background(.black.opacity(0.55))
|
.background(.black.opacity(0.55))
|
||||||
|
.onHover { hovering in
|
||||||
|
bridge.isInteracting = hovering
|
||||||
|
if hovering { bridge.recordInteraction() }
|
||||||
|
}
|
||||||
|
.onTapGesture { bridge.recordInteraction() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -330,6 +330,10 @@ final class PlayerBridge: ObservableObject {
|
|||||||
|
|
||||||
// MARK: - 播放列表窗口
|
// MARK: - 播放列表窗口
|
||||||
@Published var showPlaylistSheet = false
|
@Published var showPlaylistSheet = false
|
||||||
|
@Published var lastInteraction = Date()
|
||||||
|
@Published var isInteracting = false
|
||||||
|
|
||||||
|
func recordInteraction() { lastInteraction = Date() }
|
||||||
|
|
||||||
func togglePlaylistWindow() {
|
func togglePlaylistWindow() {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user