aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-07-17 22:19:03 +0000
committerrowanbeentje <rowan@beent.je>2010-07-17 22:19:03 +0000
commit8a5c8b954e00302cf5de32edcaf12c0b7b3eed82 (patch)
tree371712798726ca1ba674a77a0e6c9a12e40fff3a /Source
parent8f5362b01faf105b6ff8d1cafaccf5a72560d7e9 (diff)
downloadsequelpro-8a5c8b954e00302cf5de32edcaf12c0b7b3eed82.tar.gz
sequelpro-8a5c8b954e00302cf5de32edcaf12c0b7b3eed82.tar.bz2
sequelpro-8a5c8b954e00302cf5de32edcaf12c0b7b3eed82.zip
Tweak structure view index collapsing:
- Make the minimum index view size a little smaller - Add a button to reveal the indexes subview when it is collapsed. This button is hidden when te index view is not collapsed. This addresses Issue #746
Diffstat (limited to 'Source')
-rw-r--r--Source/SPTableStructure.h5
-rw-r--r--Source/SPTableStructure.m21
2 files changed, 24 insertions, 2 deletions
diff --git a/Source/SPTableStructure.h b/Source/SPTableStructure.h
index 5c50ec85..f81078b1 100644
--- a/Source/SPTableStructure.h
+++ b/Source/SPTableStructure.h
@@ -51,6 +51,8 @@
IBOutlet id removeIndexButton;
IBOutlet id refreshIndexesButton;
IBOutlet id indexesTableView;
+ IBOutlet NSSplitView *tablesIndexesSplitView;
+ IBOutlet NSButton *indexesShowButton;
MCPConnection *mySQLConnection;
MCPResult *tableSourceResult;
@@ -99,4 +101,7 @@
- (void)startDocumentTaskForTab:(NSNotification *)aNotification;
- (void)endDocumentTaskForTab:(NSNotification *)aNotification;
+// Split view interaction
+- (IBAction)unhideIndexesView:(id)sender;
+
@end
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index 957ea21c..0c51f083 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -1549,12 +1549,12 @@ would result in a position change.
- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset
{
- return proposedMax - 150;
+ return proposedMax - 130;
}
- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset
{
- return proposedMin + 150;
+ return proposedMin + 130;
}
- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex
@@ -1562,6 +1562,23 @@ would result in a position change.
return [structureGrabber convertRect:[structureGrabber bounds] toView:splitView];
}
+- (void)splitViewDidResizeSubviews:(NSNotification *)aNotification
+{
+ if ([aNotification object] == tablesIndexesSplitView) {
+ NSView *indexesView = [[tablesIndexesSplitView subviews] objectAtIndex:1];
+ if ([tablesIndexesSplitView isSubviewCollapsed:indexesView]) {
+ [indexesShowButton setHidden:NO];
+ } else {
+ [indexesShowButton setHidden:YES];
+ }
+ }
+}
+
+- (IBAction)unhideIndexesView:(id)sender
+{
+ [tablesIndexesSplitView setPosition:[tablesIndexesSplitView frame].size.height-130 ofDividerAtIndex:0];
+}
+
#pragma mark -
#pragma mark Private API methods