-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from banjun/borderless
Use borderless window during non-active
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 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
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,24 @@ | ||
// | ||
// BorderlessWindowDelegate.swift | ||
// PhotoStudioPlayer | ||
// | ||
// Created by mzp on 2017/12/20. | ||
// Copyright © 2017 banjun. All rights reserved. | ||
// | ||
import Cocoa | ||
|
||
class BorderlessWindowDelegate: NSObject, NSWindowDelegate { | ||
func windowDidBecomeKey(_ notification: Notification) { | ||
guard let window = notification.object as? NSWindow else { | ||
return | ||
} | ||
window.styleMask = [.titled, .fullSizeContentView, .closable, .miniaturizable, .resizable] | ||
|
||
} | ||
func windowDidResignKey(_ notification: Notification) { | ||
guard let window = notification.object as? NSWindow else { | ||
return | ||
} | ||
window.styleMask = [.titled, .fullSizeContentView, .borderless] | ||
} | ||
} |