aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authoravenjamin <avenjamin@gmail.com>2009-06-10 11:25:33 +0000
committeravenjamin <avenjamin@gmail.com>2009-06-10 11:25:33 +0000
commit65ad99e8fdbce63bcf65151d5f77403683959349 (patch)
tree969beaba0b5058f39d9668f67b3a9352806c55ad /Source/TableDocument.m
parent33f0e7a530714b3f95ef45860565934528b2f575 (diff)
downloadsequelpro-65ad99e8fdbce63bcf65151d5f77403683959349.tar.gz
sequelpro-65ad99e8fdbce63bcf65151d5f77403683959349.tar.bz2
sequelpro-65ad99e8fdbce63bcf65151d5f77403683959349.zip
- Table Info pane now has fixed height
- Table Info pane is collapsable - Export Controller code cleanup
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m52
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