feat: window title hides/shows with toolbar on idle timeout
This commit is contained in:
parent
fc95254500
commit
6e94bb46b7
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user