Make the Preferences window a panel.

This enables the standard behaviour of dismissing the panel with the <esc> key.
This commit is contained in:
Kevin LaCoste
2010-03-16 13:27:34 +09:00
committed by Dave Grijalva
parent b87f9b0e35
commit 64f2745dfa
+2 -2
View File
@@ -74,13 +74,13 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil;
// Create a new window to display the preference views.
// If the developer attached a window to this controller
// in Interface Builder, it gets replaced with this one.
NSWindow *window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,1000,1000)
NSPanel *panel = [[[NSPanel alloc] initWithContentRect:NSMakeRect(0,0,1000,1000)
styleMask:(NSTitledWindowMask |
NSClosableWindowMask |
NSMiniaturizableWindowMask)
backing:NSBackingStoreBuffered
defer:YES] autorelease];
[self setWindow:window];
[self setWindow:panel];
contentSubview = [[[NSView alloc] initWithFrame:[[[self window] contentView] frame]] autorelease];
[contentSubview setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)];
[[[self window] contentView] addSubview:contentSubview];