-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBorderlessWindow.m
More file actions
44 lines (37 loc) · 1.12 KB
/
BorderlessWindow.m
File metadata and controls
44 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// BorderlessWindow.m
// Drama Button
//
// Created by Martin Schend on 06.04.10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "BorderlessWindow.h"
@implementation BorderlessWindow
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)windowStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)deferCreation
{
self = [super
initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:bufferingType
defer:deferCreation];
if (self)
{
[self setMovableByWindowBackground:YES];
//[self setOpaque:NO];
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
[[self windowController] setShouldCascadeWindows:NO]; // Tell the controller to not cascade its windows.
[self setFrameAutosaveName:[self representedFilename]]; // Specify the autosave name for the window.
}
return self;
}
/*
Custom windows that use the NSBorderlessWindowMask can't become key by default. Override this method so that controls in this window will be enabled.
*/
- (BOOL)canBecomeKeyWindow {
return YES;
}
@end