summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_cb_common.swift
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2019-03-29 20:36:34 +0100
committerJan Ekström <jeebjp@gmail.com>2019-04-02 02:09:01 +0300
commitd5be1e272965176cb974d41fa4f6f94ada074a04 (patch)
treefd27c8eec52907278c3b404ad9fc4384d7996446 /video/out/cocoa_cb_common.swift
parent9d5805fba4d60524aaa023e0a47a06c3547fc841 (diff)
downloadmpv-d5be1e272965176cb974d41fa4f6f94ada074a04.tar.bz2
mpv-d5be1e272965176cb974d41fa4f6f94ada074a04.tar.xz
cocoa-cb: move all title bar related functionality in its own file
quite a lot of the title bar functionality and logic was within our window. since we recently added a custom title bar class to our window i decided to move all that functionality into that class and in its own file. this is also a preparation for the next commits.
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r--video/out/cocoa_cb_common.swift5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 15f419e207..cf714bfa4d 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -22,6 +22,7 @@ class CocoaCB: NSObject {
var mpv: MPVHelper!
var window: Window!
+ var titleBar: TitleBar!
var view: EventsView!
var layer: VideoLayer!
var link: CVDisplayLink?
@@ -101,6 +102,8 @@ class CocoaCB: NSObject {
window.title = title
window.border = Bool(opts.border)
+ titleBar = TitleBar(frame: wr, window: window, cocoaCB: self)
+
window.isRestorable = false
window.makeMain()
window.makeKeyAndOrderFront(nil)
@@ -512,7 +515,7 @@ class CocoaCB: NSObject {
}
case "macos-title-bar-style":
if let data = MPVHelper.mpvStringArrayToString(property.data) {
- window.setTitleBarStyle(data)
+ titleBar.setStyle(data)
}
default:
break