ui: blend titlebars into player background
This commit is contained in:
@@ -998,7 +998,6 @@ final class PlayerModel: ObservableObject {
|
||||
|
||||
@MainActor
|
||||
private struct PlayerGlass: NSViewRepresentable {
|
||||
var titlebar = false
|
||||
var blendingMode: NSVisualEffectView.BlendingMode = .withinWindow
|
||||
|
||||
func makeNSView(context: Context) -> NSVisualEffectView {
|
||||
@@ -1006,7 +1005,7 @@ private struct PlayerGlass: NSViewRepresentable {
|
||||
view.blendingMode = blendingMode
|
||||
view.state = .active
|
||||
view.appearance = NSAppearance(named: .vibrantDark)
|
||||
view.material = titlebar ? .titlebar : .hudWindow
|
||||
view.material = .hudWindow
|
||||
return view
|
||||
}
|
||||
|
||||
@@ -1245,7 +1244,6 @@ private struct PlayerContent: View {
|
||||
.padding(.trailing, 12)
|
||||
.frame(height: 32)
|
||||
.foregroundStyle(.white.opacity(0.6))
|
||||
.background(PlayerGlass(titlebar: true).allowsHitTesting(false))
|
||||
.onHover(perform: model.setTitleHovered)
|
||||
.opacity(model.controlsVisible ? 1 : 0)
|
||||
.allowsHitTesting(model.controlsVisible)
|
||||
@@ -1500,7 +1498,6 @@ private struct PlayerContent: View {
|
||||
.padding(8)
|
||||
.frame(maxWidth: .infinity)
|
||||
.foregroundStyle(.white.opacity(0.75))
|
||||
.background(PlayerGlass(titlebar: true))
|
||||
.opacity(model.controlsVisible ? 1 : 0)
|
||||
.allowsHitTesting(false)
|
||||
.accessibilityHidden(!model.controlsVisible)
|
||||
@@ -1617,6 +1614,7 @@ private struct WindowChrome: NSViewRepresentable {
|
||||
window.styleMask.insert(.fullSizeContentView)
|
||||
window.titleVisibility = .hidden
|
||||
window.titlebarAppearsTransparent = true
|
||||
window.titlebarSeparatorStyle = .none
|
||||
window.isOpaque = false
|
||||
window.backgroundColor = .clear
|
||||
window.acceptsMouseMovedEvents = true
|
||||
|
||||
Reference in New Issue
Block a user