diff options
author | stuconnolly <stuart02@gmail.com> | 2009-04-18 20:05:38 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-04-18 20:05:38 +0000 |
commit | 74dc396081a0a721105f3e95bd9b6f1f036d575a (patch) | |
tree | 2fc9bfb9cd502bf50a84d439127e0bd8fe75997d /Source/SPPreferenceController.m | |
parent | a91db057f3d376002184ee737198932f40ee57e1 (diff) | |
download | sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.tar.gz sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.tar.bz2 sequelpro-74dc396081a0a721105f3e95bd9b6f1f036d575a.zip |
Make SPPreferenceController the delegate of the favorites manager splitview and implement maximum and minimum split view sizes.
Diffstat (limited to 'Source/SPPreferenceController.m')
-rw-r--r-- | Source/SPPreferenceController.m | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 8ea4e7f0..0d44a373 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -217,7 +217,6 @@ [prefs setObject:[NSNumber numberWithInt:currentVersionNumber] forKey:@"LastUsedVersion"]; } - #pragma mark - #pragma mark IBAction methods @@ -319,7 +318,6 @@ } - // ------------------------------------------------------------------------------- // updateDefaultFavorite: // ------------------------------------------------------------------------------- @@ -335,7 +333,6 @@ } } - #pragma mark - #pragma mark Toolbar item IBAction methods @@ -505,7 +502,6 @@ return YES; } - #pragma mark - #pragma mark TableView delegate methods @@ -599,16 +595,24 @@ return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, nil]; } +#pragma mark - +#pragma mark SplitView delegate methods + // ------------------------------------------------------------------------------- -// dealloc +// splitView:constrainMaxCoordinate:ofSubviewAt: // ------------------------------------------------------------------------------- -- (void)dealloc +- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset { - [keychain release], keychain = nil; - - [super dealloc]; + return (proposedMax - 220); } +// ------------------------------------------------------------------------------- +// splitView:constrainMinCoordinate:ofSubviewAt: +// ------------------------------------------------------------------------------- +- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset +{ + return (proposedMin + 100); +} #pragma mark - #pragma mark TextField delegate methods @@ -667,7 +671,6 @@ return YES; } - #pragma mark - #pragma mark Window delegate methods @@ -677,17 +680,14 @@ // ------------------------------------------------------------------------------- - (void)windowWillClose:(NSNotification *)notification { - // Mark the currently selected field in the window as having finished editing, to trigger saves. if ([preferencesWindow firstResponder]) [preferencesWindow endEditingFor:[preferencesWindow firstResponder]]; } - #pragma mark - #pragma mark Other - // ------------------------------------------------------------------------------- // updateDefaultFavoritePopup: // @@ -728,9 +728,17 @@ [favoritesController setSelectedObjects:favorites]; } -@end - +// ------------------------------------------------------------------------------- +// dealloc +// ------------------------------------------------------------------------------- +- (void)dealloc +{ + [keychain release], keychain = nil; + + [super dealloc]; +} +@end #pragma mark - @@ -811,18 +819,20 @@ - (void)_resizeWindowForContentView:(NSView *)view { // remove all current views - NSEnumerator *en = [[[preferencesWindow contentView] subviews] objectEnumerator]; - NSView *subview; - while (subview = [en nextObject]) { - [subview removeFromSuperview]; - } + NSEnumerator *en = [[[preferencesWindow contentView] subviews] objectEnumerator]; + NSView *subview; + + while (subview = [en nextObject]) + { + [subview removeFromSuperview]; + } - // resize window - [preferencesWindow resizeForContentView:view titleBarVisible:YES]; + // resize window + [preferencesWindow resizeForContentView:view titleBarVisible:YES]; - // add view - [[preferencesWindow contentView] addSubview:view]; - [view setFrameOrigin:NSMakePoint(0, 0)]; + // add view + [[preferencesWindow contentView] addSubview:view]; + [view setFrameOrigin:NSMakePoint(0, 0)]; } @end |