summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_cb_common.swift
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-02-16 13:07:15 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-28 00:48:44 -0800
commit938ad6ebc037ebb32b41619a31b15f8ade712867 (patch)
treefc8c27e6c73f79a75de42032dabdd3650ef54601 /video/out/cocoa_cb_common.swift
parenta4c436bac26cc9a6f257764bbb268adde8ef8496 (diff)
downloadmpv-938ad6ebc037ebb32b41619a31b15f8ade712867.tar.bz2
mpv-938ad6ebc037ebb32b41619a31b15f8ade712867.tar.xz
cocoa-cb: change border and borderless window styling
the title bar is now within the window bounds instead of outside. same as QuickTime Player. it supports several standard styles, two dark and two light ones. additionally we have properly rounded corners now and the borderless window also has the proper window shadow. Also make the earliest supported macOS version 10.10. Fixes #4789, #3944
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r--video/out/cocoa_cb_common.swift8
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index cd43195a3e..c18bb29971 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -99,12 +99,12 @@ class CocoaCB: NSObject {
screen: targetScreen, cocoaCB: self)
win.title = window.title
win.setOnTop(mpv.getBoolProperty("ontop"))
- win.setBorder(mpv.getBoolProperty("border"))
win.keepAspect = mpv.getBoolProperty("keepaspect-window")
window.close()
window = win
window.contentView!.addSubview(view)
view.frame = window.contentView!.frame
+ window.initTitleBar()
setAppIcon()
window.isRestorable = false
@@ -486,7 +486,7 @@ class CocoaCB: NSObject {
switch String(cString: property.name) {
case "border":
if let data = MPVHelper.mpvFlagToBool(property.data) {
- window.setBorder(data)
+ window.border = data
}
case "ontop":
if let data = MPVHelper.mpvFlagToBool(property.data) {
@@ -496,6 +496,10 @@ class CocoaCB: NSObject {
if let data = MPVHelper.mpvFlagToBool(property.data) {
window.keepAspect = data
}
+ case "macos-title-bar-style":
+ if let data = MPVHelper.mpvStringArrayToString(property.data) {
+ window.setTitleBarStyle(data)
+ }
default:
break
}