├── Screen Shot.png
├── README.md
├── Overlay Test.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── .gitignore
└── Overlay Test
├── Assets.xcassets
└── AppIcon.appiconset
│ └── Contents.json
├── Info.plist
├── AppDelegate.swift
└── Base.lproj
└── MainMenu.xib
/Screen Shot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/marcomasser/OverlayTest/HEAD/Screen Shot.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Shows how to create a window that looks like the volume change indication on OS X El Capitan.
2 |
3 | 
4 |
--------------------------------------------------------------------------------
/Overlay Test.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
28 | # Carthage
29 | #
30 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
31 | # Carthage/Checkouts
32 |
33 | Carthage/Build
34 |
--------------------------------------------------------------------------------
/Overlay Test/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/Overlay Test/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2015 Objective Development Software GmbH. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Overlay Test/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Overlay Test
4 | //
5 | // Created by Marco Masser on 2015-09-19.
6 | // Copyright © 2015 Objective Development Software GmbH. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 | @IBOutlet weak var window: NSWindow!
15 | @IBOutlet weak var visualEffectView: NSVisualEffectView!
16 |
17 |
18 | func applicationDidFinishLaunching(aNotification: NSNotification) {
19 | window.isMovableByWindowBackground = true
20 | visualEffectView.maskImage = _maskImage(cornerRadius: 20.0)
21 | visualEffectView.state = .active
22 | visualEffectView.material = .dark
23 | }
24 |
25 | private func _maskImage(cornerRadius: CGFloat) -> NSImage {
26 | let edgeLength = 2.0 * cornerRadius + 1.0
27 | let maskImage = NSImage(size: NSSize(width: edgeLength, height: edgeLength), flipped: false) { rect in
28 | let bezierPath = NSBezierPath(roundedRect: rect, xRadius: cornerRadius, yRadius: cornerRadius)
29 | NSColor.black.set()
30 | bezierPath.fill()
31 | return true
32 | }
33 | maskImage.capInsets = NSEdgeInsets(top: cornerRadius, left: cornerRadius, bottom: cornerRadius, right: cornerRadius)
34 | maskImage.resizingMode = .stretch
35 | return maskImage
36 | }
37 |
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/Overlay Test.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | A92D29ED1BAE002A00585BD5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92D29EC1BAE002A00585BD5 /* AppDelegate.swift */; };
11 | A92D29EF1BAE002A00585BD5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A92D29EE1BAE002A00585BD5 /* Assets.xcassets */; };
12 | A92D29F21BAE002A00585BD5 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A92D29F01BAE002A00585BD5 /* MainMenu.xib */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | A92D29E91BAE002A00585BD5 /* Overlay Test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Overlay Test.app"; sourceTree = BUILT_PRODUCTS_DIR; };
17 | A92D29EC1BAE002A00585BD5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
18 | A92D29EE1BAE002A00585BD5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
19 | A92D29F11BAE002A00585BD5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
20 | A92D29F31BAE002A00585BD5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
21 | /* End PBXFileReference section */
22 |
23 | /* Begin PBXFrameworksBuildPhase section */
24 | A92D29E61BAE002A00585BD5 /* Frameworks */ = {
25 | isa = PBXFrameworksBuildPhase;
26 | buildActionMask = 2147483647;
27 | files = (
28 | );
29 | runOnlyForDeploymentPostprocessing = 0;
30 | };
31 | /* End PBXFrameworksBuildPhase section */
32 |
33 | /* Begin PBXGroup section */
34 | A92D29E01BAE002A00585BD5 = {
35 | isa = PBXGroup;
36 | children = (
37 | A92D29EB1BAE002A00585BD5 /* Overlay Test */,
38 | A92D29EA1BAE002A00585BD5 /* Products */,
39 | );
40 | sourceTree = "";
41 | };
42 | A92D29EA1BAE002A00585BD5 /* Products */ = {
43 | isa = PBXGroup;
44 | children = (
45 | A92D29E91BAE002A00585BD5 /* Overlay Test.app */,
46 | );
47 | name = Products;
48 | sourceTree = "";
49 | };
50 | A92D29EB1BAE002A00585BD5 /* Overlay Test */ = {
51 | isa = PBXGroup;
52 | children = (
53 | A92D29EC1BAE002A00585BD5 /* AppDelegate.swift */,
54 | A92D29EE1BAE002A00585BD5 /* Assets.xcassets */,
55 | A92D29F01BAE002A00585BD5 /* MainMenu.xib */,
56 | A92D29F31BAE002A00585BD5 /* Info.plist */,
57 | );
58 | path = "Overlay Test";
59 | sourceTree = "";
60 | };
61 | /* End PBXGroup section */
62 |
63 | /* Begin PBXNativeTarget section */
64 | A92D29E81BAE002A00585BD5 /* Overlay Test */ = {
65 | isa = PBXNativeTarget;
66 | buildConfigurationList = A92D29F61BAE002A00585BD5 /* Build configuration list for PBXNativeTarget "Overlay Test" */;
67 | buildPhases = (
68 | A92D29E51BAE002A00585BD5 /* Sources */,
69 | A92D29E61BAE002A00585BD5 /* Frameworks */,
70 | A92D29E71BAE002A00585BD5 /* Resources */,
71 | );
72 | buildRules = (
73 | );
74 | dependencies = (
75 | );
76 | name = "Overlay Test";
77 | productName = "Overlay Test";
78 | productReference = A92D29E91BAE002A00585BD5 /* Overlay Test.app */;
79 | productType = "com.apple.product-type.application";
80 | };
81 | /* End PBXNativeTarget section */
82 |
83 | /* Begin PBXProject section */
84 | A92D29E11BAE002A00585BD5 /* Project object */ = {
85 | isa = PBXProject;
86 | attributes = {
87 | LastUpgradeCheck = 1120;
88 | ORGANIZATIONNAME = "Objective Development Software GmbH";
89 | TargetAttributes = {
90 | A92D29E81BAE002A00585BD5 = {
91 | CreatedOnToolsVersion = 7.0;
92 | };
93 | };
94 | };
95 | buildConfigurationList = A92D29E41BAE002A00585BD5 /* Build configuration list for PBXProject "Overlay Test" */;
96 | compatibilityVersion = "Xcode 3.2";
97 | developmentRegion = en;
98 | hasScannedForEncodings = 0;
99 | knownRegions = (
100 | en,
101 | Base,
102 | );
103 | mainGroup = A92D29E01BAE002A00585BD5;
104 | productRefGroup = A92D29EA1BAE002A00585BD5 /* Products */;
105 | projectDirPath = "";
106 | projectRoot = "";
107 | targets = (
108 | A92D29E81BAE002A00585BD5 /* Overlay Test */,
109 | );
110 | };
111 | /* End PBXProject section */
112 |
113 | /* Begin PBXResourcesBuildPhase section */
114 | A92D29E71BAE002A00585BD5 /* Resources */ = {
115 | isa = PBXResourcesBuildPhase;
116 | buildActionMask = 2147483647;
117 | files = (
118 | A92D29EF1BAE002A00585BD5 /* Assets.xcassets in Resources */,
119 | A92D29F21BAE002A00585BD5 /* MainMenu.xib in Resources */,
120 | );
121 | runOnlyForDeploymentPostprocessing = 0;
122 | };
123 | /* End PBXResourcesBuildPhase section */
124 |
125 | /* Begin PBXSourcesBuildPhase section */
126 | A92D29E51BAE002A00585BD5 /* Sources */ = {
127 | isa = PBXSourcesBuildPhase;
128 | buildActionMask = 2147483647;
129 | files = (
130 | A92D29ED1BAE002A00585BD5 /* AppDelegate.swift in Sources */,
131 | );
132 | runOnlyForDeploymentPostprocessing = 0;
133 | };
134 | /* End PBXSourcesBuildPhase section */
135 |
136 | /* Begin PBXVariantGroup section */
137 | A92D29F01BAE002A00585BD5 /* MainMenu.xib */ = {
138 | isa = PBXVariantGroup;
139 | children = (
140 | A92D29F11BAE002A00585BD5 /* Base */,
141 | );
142 | name = MainMenu.xib;
143 | sourceTree = "";
144 | };
145 | /* End PBXVariantGroup section */
146 |
147 | /* Begin XCBuildConfiguration section */
148 | A92D29F41BAE002A00585BD5 /* Debug */ = {
149 | isa = XCBuildConfiguration;
150 | buildSettings = {
151 | ALWAYS_SEARCH_USER_PATHS = NO;
152 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
153 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
154 | CLANG_CXX_LIBRARY = "libc++";
155 | CLANG_ENABLE_MODULES = YES;
156 | CLANG_ENABLE_OBJC_ARC = YES;
157 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
158 | CLANG_WARN_BOOL_CONVERSION = YES;
159 | CLANG_WARN_COMMA = YES;
160 | CLANG_WARN_CONSTANT_CONVERSION = YES;
161 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
162 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
163 | CLANG_WARN_EMPTY_BODY = YES;
164 | CLANG_WARN_ENUM_CONVERSION = YES;
165 | CLANG_WARN_INFINITE_RECURSION = YES;
166 | CLANG_WARN_INT_CONVERSION = YES;
167 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
168 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
169 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
170 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
171 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
172 | CLANG_WARN_STRICT_PROTOTYPES = YES;
173 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
174 | CLANG_WARN_UNREACHABLE_CODE = YES;
175 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
176 | CODE_SIGN_IDENTITY = "-";
177 | COPY_PHASE_STRIP = NO;
178 | DEBUG_INFORMATION_FORMAT = dwarf;
179 | ENABLE_STRICT_OBJC_MSGSEND = YES;
180 | ENABLE_TESTABILITY = YES;
181 | GCC_C_LANGUAGE_STANDARD = gnu99;
182 | GCC_DYNAMIC_NO_PIC = NO;
183 | GCC_NO_COMMON_BLOCKS = YES;
184 | GCC_OPTIMIZATION_LEVEL = 0;
185 | GCC_PREPROCESSOR_DEFINITIONS = (
186 | "DEBUG=1",
187 | "$(inherited)",
188 | );
189 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
190 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
191 | GCC_WARN_UNDECLARED_SELECTOR = YES;
192 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
193 | GCC_WARN_UNUSED_FUNCTION = YES;
194 | GCC_WARN_UNUSED_VARIABLE = YES;
195 | MACOSX_DEPLOYMENT_TARGET = 10.11;
196 | MTL_ENABLE_DEBUG_INFO = YES;
197 | ONLY_ACTIVE_ARCH = YES;
198 | SDKROOT = macosx;
199 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
200 | SWIFT_VERSION = 5.0;
201 | };
202 | name = Debug;
203 | };
204 | A92D29F51BAE002A00585BD5 /* Release */ = {
205 | isa = XCBuildConfiguration;
206 | buildSettings = {
207 | ALWAYS_SEARCH_USER_PATHS = NO;
208 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
210 | CLANG_CXX_LIBRARY = "libc++";
211 | CLANG_ENABLE_MODULES = YES;
212 | CLANG_ENABLE_OBJC_ARC = YES;
213 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
214 | CLANG_WARN_BOOL_CONVERSION = YES;
215 | CLANG_WARN_COMMA = YES;
216 | CLANG_WARN_CONSTANT_CONVERSION = YES;
217 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
218 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
219 | CLANG_WARN_EMPTY_BODY = YES;
220 | CLANG_WARN_ENUM_CONVERSION = YES;
221 | CLANG_WARN_INFINITE_RECURSION = YES;
222 | CLANG_WARN_INT_CONVERSION = YES;
223 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
224 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
225 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
226 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
227 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
228 | CLANG_WARN_STRICT_PROTOTYPES = YES;
229 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
230 | CLANG_WARN_UNREACHABLE_CODE = YES;
231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
232 | CODE_SIGN_IDENTITY = "-";
233 | COPY_PHASE_STRIP = NO;
234 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
235 | ENABLE_NS_ASSERTIONS = NO;
236 | ENABLE_STRICT_OBJC_MSGSEND = YES;
237 | GCC_C_LANGUAGE_STANDARD = gnu99;
238 | GCC_NO_COMMON_BLOCKS = YES;
239 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
240 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
241 | GCC_WARN_UNDECLARED_SELECTOR = YES;
242 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
243 | GCC_WARN_UNUSED_FUNCTION = YES;
244 | GCC_WARN_UNUSED_VARIABLE = YES;
245 | MACOSX_DEPLOYMENT_TARGET = 10.11;
246 | MTL_ENABLE_DEBUG_INFO = NO;
247 | SDKROOT = macosx;
248 | SWIFT_COMPILATION_MODE = wholemodule;
249 | SWIFT_VERSION = 5.0;
250 | };
251 | name = Release;
252 | };
253 | A92D29F71BAE002A00585BD5 /* Debug */ = {
254 | isa = XCBuildConfiguration;
255 | buildSettings = {
256 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
257 | CODE_SIGN_IDENTITY = "-";
258 | COMBINE_HIDPI_IMAGES = YES;
259 | INFOPLIST_FILE = "Overlay Test/Info.plist";
260 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
261 | PRODUCT_BUNDLE_IDENTIFIER = "at.obdev.Overlay-Test";
262 | PRODUCT_NAME = "$(TARGET_NAME)";
263 | };
264 | name = Debug;
265 | };
266 | A92D29F81BAE002A00585BD5 /* Release */ = {
267 | isa = XCBuildConfiguration;
268 | buildSettings = {
269 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
270 | CODE_SIGN_IDENTITY = "-";
271 | COMBINE_HIDPI_IMAGES = YES;
272 | INFOPLIST_FILE = "Overlay Test/Info.plist";
273 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
274 | PRODUCT_BUNDLE_IDENTIFIER = "at.obdev.Overlay-Test";
275 | PRODUCT_NAME = "$(TARGET_NAME)";
276 | };
277 | name = Release;
278 | };
279 | /* End XCBuildConfiguration section */
280 |
281 | /* Begin XCConfigurationList section */
282 | A92D29E41BAE002A00585BD5 /* Build configuration list for PBXProject "Overlay Test" */ = {
283 | isa = XCConfigurationList;
284 | buildConfigurations = (
285 | A92D29F41BAE002A00585BD5 /* Debug */,
286 | A92D29F51BAE002A00585BD5 /* Release */,
287 | );
288 | defaultConfigurationIsVisible = 0;
289 | defaultConfigurationName = Release;
290 | };
291 | A92D29F61BAE002A00585BD5 /* Build configuration list for PBXNativeTarget "Overlay Test" */ = {
292 | isa = XCConfigurationList;
293 | buildConfigurations = (
294 | A92D29F71BAE002A00585BD5 /* Debug */,
295 | A92D29F81BAE002A00585BD5 /* Release */,
296 | );
297 | defaultConfigurationIsVisible = 0;
298 | defaultConfigurationName = Release;
299 | };
300 | /* End XCConfigurationList section */
301 | };
302 | rootObject = A92D29E11BAE002A00585BD5 /* Project object */;
303 | }
304 |
--------------------------------------------------------------------------------
/Overlay Test/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
--------------------------------------------------------------------------------