feat: window title hides/shows with toolbar on idle timeout

This commit is contained in:
yumoqing 2026-06-25 09:00:56 +08:00
parent fc95254500
commit 6e94bb46b7

View File

@ -266,6 +266,8 @@ struct PlayerContentView: View {
} }
} }
.onChange(of: showToolbar) { _, newValue in .onChange(of: showToolbar) { _, newValue in
// /
NSApplication.shared.windows.first?.titleVisibility = newValue ? .visible : .hidden
if newValue { if newValue {
resetHideTimer() resetHideTimer()
} else { } else {
@ -275,6 +277,10 @@ struct PlayerContentView: View {
.onDisappear { .onDisappear {
hideTimer?.invalidate() hideTimer?.invalidate()
} }
.onAppear {
// toolbar
NSApplication.shared.windows.first?.titleVisibility = .hidden
}
} }
} }