feat: toolbar auto-hides after 60s of no interaction

This commit is contained in:
yumoqing 2026-06-22 00:12:43 +08:00
parent 2fd6db3a4e
commit 1fa6f6a4bb
2 changed files with 9 additions and 0 deletions

View File

@ -202,6 +202,11 @@ struct ControlToolbar: View {
.padding(.horizontal, 16)
.padding(.vertical, 8)
.background(.black.opacity(0.55))
.onHover { hovering in
bridge.isInteracting = hovering
if hovering { bridge.recordInteraction() }
}
.onTapGesture { bridge.recordInteraction() }
}
}

View File

@ -330,6 +330,10 @@ final class PlayerBridge: ObservableObject {
// MARK: -
@Published var showPlaylistSheet = false
@Published var lastInteraction = Date()
@Published var isInteracting = false
func recordInteraction() { lastInteraction = Date() }
func togglePlaylistWindow() {
#if os(macOS)