-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the way a window is moved. Fixes #6
- Loading branch information
1 parent
d6789b4
commit 5624491
Showing
7 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+9.44 KB
(120%)
YT Music.xcworkspace/xcuserdata/steve228uk.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// WindowMovableView.swift | ||
// YT Music | ||
// | ||
// Created by Stephen Radford on 01/07/2018. | ||
// Copyright © 2018 Cocoon Development Ltd. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class WindowMovableView: NSView { | ||
|
||
override var mouseDownCanMoveWindow: Bool { | ||
return true | ||
} | ||
|
||
override var isOpaque: Bool { | ||
return false | ||
} | ||
|
||
override func acceptsFirstMouse(for event: NSEvent?) -> Bool { | ||
return true | ||
} | ||
|
||
override func mouseDragged(with event: NSEvent) { | ||
window?.performDrag(with: event) | ||
} | ||
|
||
override func mouseUp(with event: NSEvent) { | ||
guard event.clickCount == 2, let window = window else { return } | ||
window.setIsZoomed(!window.isZoomed) | ||
} | ||
|
||
} |