This commit is contained in:
Lord-Nightmare 2015-04-09 18:34:17 -04:00
commit fc7b27b036
2 changed files with 31 additions and 19 deletions

View File

@ -132,23 +132,23 @@
[window makeFirstResponder:commandField]; [window makeFirstResponder:commandField];
// calculate the optimal size for everything // calculate the optimal size for everything
NSRect available = [[NSScreen mainScreen] visibleFrame]; NSRect const available = [[NSScreen mainScreen] visibleFrame];
NSRect windowFrame = [window frame]; NSSize const regCurrent = [regScroll frame].size;
NSSize regCurrent = [regScroll frame].size; NSSize const regSize = [NSScrollView frameSizeForContentSize:[regView maximumFrameSize]
NSSize regSize = [NSScrollView frameSizeForContentSize:[regView maximumFrameSize]
hasHorizontalScroller:YES hasHorizontalScroller:YES
hasVerticalScroller:YES hasVerticalScroller:YES
borderType:[regScroll borderType]]; borderType:[regScroll borderType]];
NSSize dasmCurrent = [dasmScroll frame].size; NSSize const dasmCurrent = [dasmScroll frame].size;
NSSize dasmSize = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize] NSSize const dasmSize = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
hasHorizontalScroller:YES hasHorizontalScroller:YES
hasVerticalScroller:YES hasVerticalScroller:YES
borderType:[dasmScroll borderType]]; borderType:[dasmScroll borderType]];
NSSize consoleCurrent = [consoleContainer frame].size; NSSize const consoleCurrent = [consoleContainer frame].size;
NSSize consoleSize = [NSScrollView frameSizeForContentSize:[consoleView maximumFrameSize] NSSize consoleSize = [NSScrollView frameSizeForContentSize:[consoleView maximumFrameSize]
hasHorizontalScroller:YES hasHorizontalScroller:YES
hasVerticalScroller:YES hasVerticalScroller:YES
borderType:[consoleScroll borderType]]; borderType:[consoleScroll borderType]];
NSRect windowFrame = [window frame];
NSSize adjustment; NSSize adjustment;
consoleSize.width += consoleCurrent.width - [consoleScroll frame].size.width; consoleSize.width += consoleCurrent.width - [consoleScroll frame].size.width;

View File

@ -306,7 +306,17 @@ static void UpdateChangeCountCallback(void *userData,
[self loadEffectUI]; [self loadEffectUI];
if (nil != restoreFrame) if (nil != restoreFrame)
{
[window setFrameFromString:restoreFrame]; [window setFrameFromString:restoreFrame];
}
else
{
NSRect const available = [[NSScreen mainScreen] visibleFrame];
NSRect frame = [window frame];
frame.origin.x = (NSWidth(available) - NSWidth(frame)) / 4;
frame.origin.y = (NSHeight(available) - NSHeight(frame)) * 3 / 4;
[window setFrame:frame display:YES animate:NO];
}
} }
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)type error:(NSError **)error { - (BOOL)readFromData:(NSData *)data ofType:(NSString *)type error:(NSError **)error {
@ -836,7 +846,9 @@ static void UpdateChangeCountCallback(void *userData,
item = [parent addItemWithTitle:@"Help" action:NULL keyEquivalent:@""]; item = [parent addItemWithTitle:@"Help" action:NULL keyEquivalent:@""];
[parent setSubmenu:menu forItem:item]; [parent setSubmenu:menu forItem:item];
[menu release]; [menu release];
[NSApp setHelpMenu:menu]; [menu setValue:@"NSHelpMenu" forKey:@"name"];
if ([NSApp respondsToSelector:@selector(setHelpMenu:)])
[NSApp performSelector:@selector(setHelpMenu:) withObject:menu];
item = [menu addItemWithTitle:[NSString stringWithFormat:@"%@ Help", appName] action:@selector(showHelp:) keyEquivalent:@"?"]; item = [menu addItemWithTitle:[NSString stringWithFormat:@"%@ Help", appName] action:@selector(showHelp:) keyEquivalent:@"?"];
} }