diff options
author | der richter <der.richter@gmx.de> | 2019-03-29 20:36:34 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-04-02 02:09:01 +0300 |
commit | d5be1e272965176cb974d41fa4f6f94ada074a04 (patch) | |
tree | fd27c8eec52907278c3b404ad9fc4384d7996446 /video/out/cocoa-cb/events_view.swift | |
parent | 9d5805fba4d60524aaa023e0a47a06c3547fc841 (diff) | |
download | mpv-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/events_view.swift')
-rw-r--r-- | video/out/cocoa-cb/events_view.swift | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/cocoa-cb/events_view.swift b/video/out/cocoa-cb/events_view.swift index aad5360d4a..b9de12ca26 100644 --- a/video/out/cocoa-cb/events_view.swift +++ b/video/out/cocoa-cb/events_view.swift @@ -135,14 +135,14 @@ class EventsView: NSView { if mpv.getBoolProperty("input-cursor") { cocoa_put_key_with_modifiers(SWIFT_KEY_MOUSE_LEAVE, 0) } - cocoaCB.window.hideTitleBar() + cocoaCB.titleBar.hide() } override func mouseMoved(with event: NSEvent) { if mpv != nil && mpv.getBoolProperty("input-cursor") { signalMouseMovement(event) } - cocoaCB.window.showTitleBar() + cocoaCB.titleBar.show() } override func mouseDragged(with event: NSEvent) { @@ -260,7 +260,7 @@ class EventsView: NSView { let menuBarHeight = NSApp.mainMenu!.menuBarHeight if cocoaCB.window.isInFullscreen && (menuBarHeight > 0) { - topMargin = cocoaCB.window.titleBarHeight + 1 + menuBarHeight + topMargin = TitleBar.height + 1 + menuBarHeight } guard var vF = window?.screen?.frame else { return false } @@ -272,8 +272,8 @@ class EventsView: NSView { var clippedBounds = bounds.intersection(vFV) if !cocoaCB.window.isInFullscreen { - clippedBounds.origin.y += cocoaCB.window.titleBarHeight - clippedBounds.size.height -= cocoaCB.window.titleBarHeight + clippedBounds.origin.y += TitleBar.height + clippedBounds.size.height -= TitleBar.height } return clippedBounds.contains(pt) } |