1.1 --- a/src/cocoaui/cocoa_prefs.c Wed Jul 23 11:11:30 2008 +0000
1.2 +++ b/src/cocoaui/cocoa_prefs.c Mon Jul 28 04:47:28 2008 +0000
1.4 static LxdreamPrefsPanel *prefs_panel = NULL;
1.6 @implementation LxdreamPrefsPane
1.7 -- (NSTextField *)addLabel: (NSString *)text withFrame: (NSRect)frame
1.9 - NSTextField *label = [[NSTextField alloc] initWithFrame: frame];
1.10 - [label setStringValue: text];
1.11 - [label setBordered: NO];
1.12 - [label setDrawsBackground: NO];
1.13 - [label setEditable: NO];
1.14 - [label setAutoresizingMask: (NSViewMinYMargin|NSViewMaxXMargin)];
1.15 - [self addSubview: label];
1.18 - (int)contentHeight
1.20 return [self frame].size.height - headerHeight;
1.22 NSFont *titleFont = [NSFont fontWithName: @"Helvetica-Bold" size: 16.0];
1.23 NSRect fontRect = [titleFont boundingRectForFont];
1.24 int titleHeight = fontRect.size.height + [titleFont descender];
1.25 - NSTextField *label = [self addLabel: title withFrame:
1.26 + NSTextField *label = cocoa_gui_add_label(self, title,
1.27 NSMakeRect( TEXT_GAP, height-titleHeight,
1.28 - frameRect.size.width - (TEXT_GAP*2), titleHeight )];
1.29 + frameRect.size.width - (TEXT_GAP*2), titleHeight ));
1.30 [label setFont: titleFont];
1.31 height -= (titleHeight + TEXT_GAP);
1.37 +/**************************** Main preferences window ************************/
1.39 @interface LxdreamPrefsPanel (Private)
1.40 - (void) initToolbar;
1.43 [self setTitle: NS_("Preferences")];
1.44 [self setDelegate: self];
1.45 + [self setMinSize: NSMakeSize(400,300)];
1.47 - path_pane = [LxdreamPrefsPathPane new];
1.48 - ctrl_pane = [LxdreamPrefsControllerPane new];
1.50 + path_pane = cocoa_gui_create_prefs_path_pane();
1.51 + ctrl_pane = cocoa_gui_create_prefs_controller_pane();
1.52 + binding_editor = nil;
1.53 [self setContentView: path_pane];
1.59 + if( binding_editor != nil ) {
1.60 + [binding_editor release];
1.61 + binding_editor = nil;
1.65 - (void)windowWillClose: (NSNotification *)notice
1.69 +- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)view
1.71 + if( [view isKindOfClass: [KeyBindingField class]] ) {
1.72 + if( binding_editor == nil ) {
1.73 + binding_editor = [[[KeyBindingEditor alloc] init] retain];
1.75 + return binding_editor;
1.79 - (void) initToolbar
1.81 NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"LxdreamPrefsToolbar"];