From 938ad6ebc037ebb32b41619a31b15f8ade712867 Mon Sep 17 00:00:00 2001 From: Akemi Date: Fri, 16 Feb 2018 13:07:15 +0100 Subject: 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 --- video/out/cocoa_cb_common.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'video/out/cocoa_cb_common.swift') 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 } -- cgit v1.2.3