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];
// calculate the optimal size for everything
NSRect available = [[NSScreen mainScreen] visibleFrame];
NSRect windowFrame = [window frame];
NSSize regCurrent = [regScroll frame].size;
NSSize regSize = [NSScrollView frameSizeForContentSize:[regView maximumFrameSize]
NSRect const available = [[NSScreen mainScreen] visibleFrame];
NSSize const regCurrent = [regScroll frame].size;
NSSize const regSize = [NSScrollView frameSizeForContentSize:[regView maximumFrameSize]
hasHorizontalScroller:YES
hasVerticalScroller:YES
borderType:[regScroll borderType]];
NSSize dasmCurrent = [dasmScroll frame].size;
NSSize dasmSize = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
NSSize const dasmCurrent = [dasmScroll frame].size;
NSSize const dasmSize = [NSScrollView frameSizeForContentSize:[dasmView maximumFrameSize]
hasHorizontalScroller:YES
hasVerticalScroller:YES
borderType:[dasmScroll borderType]];
NSSize consoleCurrent = [consoleContainer frame].size;
NSSize const consoleCurrent = [consoleContainer frame].size;
NSSize consoleSize = [NSScrollView frameSizeForContentSize:[consoleView maximumFrameSize]
hasHorizontalScroller:YES
hasVerticalScroller:YES
borderType:[consoleScroll borderType]];
NSRect windowFrame = [window frame];
NSSize adjustment;
consoleSize.width += consoleCurrent.width - [consoleScroll frame].size.width;

View File

@ -306,7 +306,17 @@ static void UpdateChangeCountCallback(void *userData,
[self loadEffectUI];
if (nil != 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 {
@ -836,7 +846,9 @@ static void UpdateChangeCountCallback(void *userData,
item = [parent addItemWithTitle:@"Help" action:NULL keyEquivalent:@""];
[parent setSubmenu:menu forItem:item];
[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:@"?"];
}