summaryrefslogtreecommitdiffstats
path: root/video/out/mac/title_bar.swift
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/mac/title_bar.swift
parentAdding upstream version 0.37.0. (diff)
downloadmpv-upstream/0.38.0.tar.xz
mpv-upstream/0.38.0.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'video/out/mac/title_bar.swift')
-rw-r--r--video/out/mac/title_bar.swift16
1 files changed, 5 insertions, 11 deletions
diff --git a/video/out/mac/title_bar.swift b/video/out/mac/title_bar.swift
index 764c1ff..b274100 100644
--- a/video/out/mac/title_bar.swift
+++ b/video/out/mac/title_bar.swift
@@ -19,7 +19,7 @@ import Cocoa
class TitleBar: NSVisualEffectView {
unowned var common: Common
- var mpv: MPVHelper? { get { return common.mpv } }
+ var option: OptionHelper { get { return common.option } }
var systemBar: NSView? {
get { return common.window?.standardWindowButton(.closeButton)?.superview }
@@ -64,9 +64,9 @@ class TitleBar: NSVisualEffectView {
window.contentView?.addSubview(self, positioned: .above, relativeTo: nil)
window.titlebarAppearsTransparent = true
window.styleMask.insert(.fullSizeContentView)
- set(appearance: Int(mpv?.macOpts.macos_title_bar_appearance ?? 0))
- set(material: Int(mpv?.macOpts.macos_title_bar_material ?? 0))
- set(color: mpv?.macOpts.macos_title_bar_color ?? "#00000000")
+ set(appearance: Int(option.mac.macos_title_bar_appearance))
+ set(material: Int(option.mac.macos_title_bar_material))
+ set(color: option.mac.macos_title_bar_color)
}
required init?(coder: NSCoder) {
@@ -195,10 +195,6 @@ class TitleBar: NSVisualEffectView {
default:
return nil
}
-
-
- let style = UserDefaults.standard.string(forKey: "AppleInterfaceStyle")
- return appearanceFrom(string: style == nil ? "aqua" : "vibrantDark")
}
func materialFrom(string: String) -> NSVisualEffectView.Material {
@@ -221,9 +217,7 @@ class TitleBar: NSVisualEffectView {
case "15", "light": return .light
case "16", "mediumLight": return .mediumLight
case "17", "ultraDark": return .ultraDark
- default: break
+ default: return .titlebar
}
-
- return .titlebar
}
}