diff options
Diffstat (limited to 'frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m')
-rw-r--r-- | frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m b/frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m index 8bf51f6dd..cae9280f1 100644 --- a/frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m +++ b/frontends/cocoa/PSMTabBarControl/PSMTabDragWindow.m @@ -11,38 +11,41 @@ @implementation PSMTabDragWindow -+ (PSMTabDragWindow *)dragWindowWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask { - return [[PSMTabDragWindow alloc] initWithImage:image styleMask:styleMask] ; ++ (PSMTabDragWindow *)dragWindowWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask +{ + return [[PSMTabDragWindow alloc] initWithImage:image styleMask:styleMask]; } -- (id)initWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask { - NSSize size = [image size]; +- (id)initWithImage:(NSImage *)image styleMask:(NSUInteger)styleMask +{ + NSSize size = [image size]; - if((self = [super initWithContentRect:NSMakeRect(0, 0, size.width, size.height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO])) { - _dragView = [[PSMTabDragView alloc] initWithFrame:NSMakeRect(0, 0, size.width, size.height)] ; - [self setContentView:_dragView]; - [self setLevel:NSStatusWindowLevel]; - [self setIgnoresMouseEvents:YES]; - [self setOpaque:NO]; + if ((self = [super initWithContentRect:NSMakeRect(0, 0, size.width, size.height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO])) { + _dragView = [[PSMTabDragView alloc] initWithFrame:NSMakeRect(0, 0, size.width, size.height)]; + [self setContentView:_dragView]; + [self setLevel:NSStatusWindowLevel]; + [self setIgnoresMouseEvents:YES]; + [self setOpaque:NO]; - [_dragView setImage:image]; + [_dragView setImage:image]; - //Set the size of the window to be the exact size of the drag image - NSRect windowFrame = [self frame]; - windowFrame.origin.y += windowFrame.size.height - size.height; - windowFrame.size = size; + //Set the size of the window to be the exact size of the drag image + NSRect windowFrame = [self frame]; + windowFrame.origin.y += windowFrame.size.height - size.height; + windowFrame.size = size; - if(styleMask | NSWindowStyleMaskBorderless) { - windowFrame.size.height += 22; - } + if (styleMask | NSWindowStyleMaskBorderless) { + windowFrame.size.height += 22; + } - [self setFrame:windowFrame display:YES]; - } - return self; + [self setFrame:windowFrame display:YES]; + } + return self; } -- (PSMTabDragView *)dragView { - return _dragView; +- (PSMTabDragView *)dragView +{ + return _dragView; } @end |