mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-27 22:10:23 +00:00
fix for nib loading code, NSWindow -init
This commit is contained in:
parent
6e72705bfd
commit
6f0bec0a62
@ -79,6 +79,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This method is Cococtron specific and can be override by subclasses, do not change method name */
|
||||
+(BOOL)hasMainMenuForStyleMask:(NSUInteger)styleMask {
|
||||
if(styleMask&NSTitledWindowMask)
|
||||
return YES;
|
||||
@ -86,6 +87,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
return NO;
|
||||
}
|
||||
|
||||
/* This method is Cococtron specific and can be override by subclasses, do not change method name. */
|
||||
-(BOOL)hasMainMenu {
|
||||
return [isa hasMainMenuForStyleMask:_styleMask];
|
||||
}
|
||||
@ -145,6 +147,10 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
|
||||
return [NSThemeFrame class];
|
||||
}
|
||||
|
||||
-init {
|
||||
return [self initWithContentRect:NSMakeRect(100,100,100,100) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];
|
||||
}
|
||||
|
||||
-initWithCoder:(NSCoder *)coder {
|
||||
[NSException raise:NSInvalidArgumentException format:@"-[%@ %s] is not implemented for coder %@",isa,sel_getName(_cmd),coder];
|
||||
return self;
|
||||
|
@ -36,7 +36,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
_windowAutosave=[[keyed decodeObjectForKey:@"NSFrameAutosaveName"] retain];
|
||||
|
||||
_windowRect.origin.y -= _screenRect.size.height - [[NSScreen mainScreen] frame].size.height;
|
||||
if ([_windowClass hasMainMenuForStyleMask:_windowStyleMask])
|
||||
if ([NSClassFromString(_windowClass) hasMainMenuForStyleMask:_windowStyleMask])
|
||||
_windowRect.origin.y -= [NSMainMenuView menuHeight]; // compensation for the additional menu bar
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user