diff options
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 9a7f863c..56ca2422 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -109,6 +109,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum // Hide the tabs in the tab view (we only show them to allow switching tabs in interface builder) [tableTabView setTabViewType:NSNoTabsNoBorder]; + [tableListSplitter setDividerStyle:NSSplitViewDividerStyleThin]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context @@ -2341,7 +2342,8 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum */ - (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview { - return NO; + + return subview == [[tableInfoTable superview] superview]; } /** @@ -2349,7 +2351,12 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum */ - (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset { - return proposedMax - 600; + if (sender == contentViewSplitter) { + return 300; + } else { + // + return proposedMax;//([tableInfoTable rowHeight] * [tableInfoTable numberOfRows] + 25); + } } /** @@ -2357,12 +2364,49 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum */ - (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset { - return proposedMin + 140; + if (sender == tableListSplitter) { + return [sender frame].size.height - [sender dividerThickness] - 145; + //return [sender frame].size.height - [sender dividerThickness] - ([tableInfoTable rowHeight] * [tableInfoTable numberOfRows] + 25); + } else { + return 160; + } +} + +-(void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize +{ + [sender adjustSubviews]; + + if (sender == tableListSplitter && + ![tableListSplitter isSubviewCollapsed:[[sender subviews] objectAtIndex:1]]) { + + CGFloat dividerThickness = [sender dividerThickness]; + NSRect topRect = [[[sender subviews] objectAtIndex:0] frame]; + NSRect bottomRect = [[[sender subviews] objectAtIndex:1] frame]; + NSRect newFrame = [sender frame]; + + topRect.size.height = newFrame.size.height - 145 - dividerThickness; + topRect.size.width = newFrame.size.width; + topRect.origin = NSMakePoint(0, 0); + + bottomRect.size.height = newFrame.size.height - topRect.size.height - dividerThickness; + bottomRect.size.width = newFrame.size.width; + bottomRect.origin.y = topRect.size.height + dividerThickness; + + [[[sender subviews] objectAtIndex:0] setFrame:topRect]; + [[[sender subviews] objectAtIndex:1] setFrame:bottomRect]; + } +} + + +- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex +{ + return NO;//splitView == tableListSplitter; } - (void)splitViewDidResizeSubviews:(NSNotification *)notification { - [self updateChooseDatabaseToolbarItemWidth]; + if ([notification object] == contentViewSplitter) + [self updateChooseDatabaseToolbarItemWidth]; } - (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(int)dividerIndex |