diff --git a/Sources/MiniPlayerApp.swift b/Sources/MiniPlayerApp.swift index 8b42cb9..9d41cf3 100644 --- a/Sources/MiniPlayerApp.swift +++ b/Sources/MiniPlayerApp.swift @@ -266,6 +266,8 @@ struct PlayerContentView: View { } } .onChange(of: showToolbar) { _, newValue in + // 同步控制窗口标题的显示/隐藏 + NSApplication.shared.windows.first?.titleVisibility = newValue ? .visible : .hidden if newValue { resetHideTimer() } else { @@ -275,6 +277,10 @@ struct PlayerContentView: View { .onDisappear { hideTimer?.invalidate() } + .onAppear { + // 初始状态:标题随toolbar一起隐藏 + NSApplication.shared.windows.first?.titleVisibility = .hidden + } } }