diff options
author | rowanbeentje <rowan@beent.je> | 2012-07-24 01:27:44 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-07-24 01:27:44 +0000 |
commit | a531651aac81aaa89e2c292be7f9273d8b629373 (patch) | |
tree | b1a1bc7891a19d4de9dd1dd31dcf715ed1e5090b /Source/SPDatabaseDocument.m | |
parent | 2c797dd704b29331dfd2704ba48f29792f6f49dd (diff) | |
download | sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.tar.gz sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.tar.bz2 sequelpro-a531651aac81aaa89e2c292be7f9273d8b629373.zip |
- Replace the main split view in the main view with a SPSplitView, replacing the anchored button bar and buttons with normal equivalents.
- Make the main split view collapsbile to avoid resize issues with the filter box
- Fix problems with additional drag handles in SPSplitView when one of the views was using flipped coordinates
- Fix problems with manually dragged uncollapses in SPSplitView
- Fix problems instantiating SPSplitView instances on 10.5 (with thanks to schlabberdog)
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 0cfec364..059e784c 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -48,6 +48,7 @@ enum { #import "ImageAndTextCell.h" #import "SPGrowlController.h" #import "SPExportController.h" +#import "SPSplitView.h" #endif #import "SPQueryController.h" #import "SPQueryDocumentsController.h" @@ -273,6 +274,9 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; // Set up the toolbar [self setupToolbar]; + // Set collapsible behaviour on the table list so collapsing behaviour handles resize issus + [contentViewSplitter setCollapsibleSubviewIndex:0]; + // Set up the connection controller connectionController = [[SPConnectionController alloc] initWithDocument:self]; @@ -358,8 +362,6 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; [taskProgressWindow setAlphaValue:0.0f]; [taskProgressWindow setContentView:taskProgressLayer]; - [contentViewSplitter setDelegate:self]; - [self updateTitlebarStatusVisibilityForcingHide:NO]; #endif } @@ -5575,20 +5577,20 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; - (void)splitViewDidResizeSubviews:(NSNotification *)notification { - // Fix tablesList search field frame after collapsing the tablesList - [listFilterField setFrameSize:NSMakeSize([[[contentViewSplitter subviews] objectAtIndex:0] frame].size.width - 8, [listFilterField frame].size.height)]; - [self updateChooseDatabaseToolbarItemWidth]; - } -- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex +- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex { - if (splitView == contentViewSplitter && sidebarGrabber != nil) { - return [sidebarGrabber splitView:splitView additionalEffectiveRectOfDividerAtIndex:dividerIndex]; - } else { - return NSZeroRect; + if (dividerIndex == 0 && proposedMinimumPosition < 40) { + return 40; } + return proposedMinimumPosition; +} + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex +{ + return proposedMaximumPosition; } - (void)updateChooseDatabaseToolbarItemWidth |