From 8a5c8b954e00302cf5de32edcaf12c0b7b3eed82 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 17 Jul 2010 22:19:03 +0000 Subject: 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 --- Interfaces/English.lproj/DBView.xib | 201 ++++++++++++++++++--------------- Resources/English.lproj/DBView.strings | Bin 95698 -> 96036 bytes Source/SPTableStructure.h | 5 + Source/SPTableStructure.m | 21 +++- 4 files changed, 131 insertions(+), 96 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index d5d6e1b5..3ff5367d 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -23,6 +23,7 @@ YES + YES @@ -90,7 +91,6 @@ 290 {{5, 2}, {204, 19}} - YES 343014976 @@ -183,7 +183,6 @@ 4362 {218, 38} - YES @@ -273,7 +272,6 @@ {{1, 1}, {218, 38}} - @@ -289,7 +287,6 @@ -2147483392 {{-100, -100}, {15, 8}} - _doScroller: 0.42105263471603394 @@ -299,7 +296,6 @@ -2147483392 {{-100, -100}, {223, 15}} - 1 _doScroller: @@ -308,7 +304,6 @@ {{-1, -13}, {220, 40}} - 2 @@ -319,7 +314,6 @@ {214, 26} - NSView @@ -342,7 +336,6 @@ 4352 {214, 354} - YES @@ -409,7 +402,6 @@ {214, 354} - @@ -420,7 +412,6 @@ -2147483392 {{197, 0}, {15, 292}} - _doScroller: 0.096045196056365967 @@ -431,7 +422,6 @@ -2147483392 {{-100, -100}, {141, 11}} - 257 _doScroller: @@ -440,7 +430,6 @@ {214, 354} - 528 @@ -451,13 +440,11 @@ {{0, 27}, {214, 354}} - NSView {214, 381} - 2 6 @@ -491,7 +478,6 @@ {214, 381} - NSView @@ -514,7 +500,6 @@ 4352 {214, 145} - YES @@ -581,7 +566,6 @@ {214, 145} - @@ -592,7 +576,6 @@ -2147483392 {{-100, -100}, {15, 20}} - _doScroller: 0.48965516686439514 @@ -603,7 +586,6 @@ -2147483392 {{-100, -100}, {141, 11}} - 257 _doScroller: @@ -612,7 +594,6 @@ {214, 145} - 512 @@ -623,13 +604,11 @@ {{0, 382}, {214, 145}} - NSView {{0, 23}, {214, 527}} - 2 NO @@ -680,7 +659,6 @@ 268 {{-1, -1}, {32, 24}} - YES 67239424 @@ -705,7 +683,6 @@ 268 {{30, -1}, {32, 24}} - YES 71433792 @@ -893,7 +870,6 @@ 268 {{61, -1}, {32, 24}} - YES 67239424 @@ -918,7 +894,6 @@ 268 {{92, -1}, {32, 24}} - YES -2080244224 @@ -945,7 +920,6 @@ {{0, 1}, {214, 23}} - YES YES NO @@ -954,7 +928,6 @@ {214, 550} - NSView @@ -967,13 +940,12 @@ 274 {{-7, -10}, {741, 564}} - YES source - + 256 YES @@ -987,6 +959,30 @@ 256 YES + + + -2147483356 + {{124, -1}, {33, 25}} + + YES + + -2080244224 + 134217728 + + + + -2041822977 + 35 + + NSImage + button_info_pane_show + + + + 400 + 75 + + 4370 @@ -1653,7 +1649,7 @@ NeXT TIFF v4.0 pasteboard type - {{125, 0}, {538, 23}} + {{125, 2}, {538, 23}} YES @@ -2235,6 +2231,7 @@ {{10, 7}, {706, 544}} + Structure @@ -2991,7 +2988,7 @@ customQuery - + 256 YES @@ -3005,7 +3002,6 @@ 268 {{0, -1}, {32, 24}} - YES -2080244224 @@ -3028,7 +3024,6 @@ 266 {{68, 1}, {611, 17}} - YES 67239424 @@ -3045,7 +3040,6 @@ 268 {{31, -1}, {32, 24}} - YES 71433792 @@ -3125,7 +3119,6 @@ {{6, 11}, {696, 23}} - NO YES NO @@ -3164,32 +3157,8 @@ 6418 - - YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - - {{0, 2}, {694, 14}} - @@ -3249,7 +3218,6 @@ {{1, 1}, {694, 148}} - @@ -3264,7 +3232,6 @@ -2147483392 {{598, 1}, {15, 68}} - _doScroller: 1 @@ -3274,7 +3241,6 @@ -2147483392 {{-100, -100}, {601, 11}} - 257 _doScroller: @@ -3284,7 +3250,6 @@ {696, 150} - 530 @@ -3294,7 +3259,6 @@ {696, 150} - NSView @@ -3317,14 +3281,12 @@ 4352 {694, 221} - YES 256 {694, 17} - @@ -3332,7 +3294,6 @@ -2147483392 {{-26, 0}, {16, 17}} - YES @@ -3382,7 +3343,6 @@ {{1, 17}, {694, 221}} - @@ -3393,7 +3353,6 @@ -2147483392 {{611, 17}, {15, 30}} - _doScroller: 0.67178362607955933 @@ -3404,7 +3363,6 @@ -2147483392 {{1, 47}, {610, 15}} - 1 _doScroller: @@ -3419,7 +3377,6 @@ {{1, 0}, {694, 17}} - @@ -3429,7 +3386,6 @@ {{0, -1}, {696, 239}} - 562 @@ -3444,7 +3400,6 @@ 268 {{156, 237}, {98, 22}} - YES -2076049856 @@ -3558,7 +3513,6 @@ 264 {{38, 237}, {108, 22}} - YES -2076049856 @@ -3673,7 +3627,6 @@ 268 {{-10, 236}, {48, 25}} - YES -2076049856 @@ -4014,7 +3967,6 @@ 265 {{563, 239}, {124, 17}} - YES -2080244224 @@ -4036,7 +3988,6 @@ 265 {{404, 239}, {151, 17}} - YES 604110336 @@ -4069,7 +4020,6 @@ {{32, 237}, {664, 23}} - YES 130560 @@ -4085,18 +4035,15 @@ {{0, 159}, {696, 260}} - NSView {696, 419} - {696, 419} - NSView @@ -4109,7 +4056,6 @@ 268 {{15, 63}, {363, 14}} - YES 68288064 @@ -4126,7 +4072,6 @@ 274 {{15, 12}, {662, 45}} - YES 69336577 @@ -4144,13 +4089,11 @@ {{0, 420}, {696, 88}} - NSView {{6, 33}, {696, 508}} - 2 NO @@ -4199,8 +4142,6 @@ {{10, 7}, {706, 544}} - - Custom Query @@ -5990,26 +5931,24 @@ - + 134217731 YES YES YES - + {{215, 0}, {729, 550}} - NSView {{0, -1}, {944, 550}} - YES 2 DBViewSplitter @@ -6017,7 +5956,6 @@ {943, 549} - NSView @@ -14539,6 +14477,30 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 7456 + + + indexesShowButton + + + + 7460 + + + + tablesIndexesSplitView + + + + 7461 + + + + unhideIndexesView: + + + + 7462 + @@ -18080,6 +18042,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + @@ -20416,6 +20379,20 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + + 7457 + + + YES + + + + + + 7458 + + + @@ -21598,6 +21575,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 7453.IBPluginDependency 7454.IBPluginDependency 7455.IBPluginDependency + 7457.IBAttributePlaceholdersKey + 7457.IBPluginDependency + 7458.IBPluginDependency 748.IBPluginDependency 748.ImportedFromIB2 749.IBPluginDependency @@ -23204,6 +23184,16 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Reveal the collapsed indexes pane + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -23246,7 +23236,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - 7456 + 7462 @@ -26990,6 +26980,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 reloadTable: removeField: resetAutoIncrement: + unhideIndexesView: YES @@ -27000,6 +26991,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 id id id + id @@ -27013,6 +27005,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 reloadTable: removeField: resetAutoIncrement: + unhideIndexesView: YES @@ -27044,6 +27037,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 resetAutoIncrement: id + + unhideIndexesView: + id + @@ -27057,6 +27054,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 editTableButton extendedTableInfoInstance indexesController + indexesShowButton indexesTableView keySheet refreshIndexesButton @@ -27071,6 +27069,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 tableDocumentInstance tableInfoInstance tableSourceView + tablesIndexesSplitView tablesListInstance @@ -27082,6 +27081,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 id id id + NSButton id id id @@ -27096,6 +27096,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 id id id + NSSplitView id @@ -27110,6 +27111,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 editTableButton extendedTableInfoInstance indexesController + indexesShowButton indexesTableView keySheet refreshIndexesButton @@ -27124,6 +27126,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 tableDocumentInstance tableInfoInstance tableSourceView + tablesIndexesSplitView tablesListInstance @@ -27156,6 +27159,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 indexesController id + + indexesShowButton + NSButton + indexesTableView id @@ -27212,6 +27219,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 tableSourceView id + + tablesIndexesSplitView + NSSplitView + tablesListInstance id @@ -28984,6 +28995,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 button_edit button_edit_mode button_edit_mode_selected + button_info_pane_show button_left button_pagination button_pane_hide_icon @@ -29015,6 +29027,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {32, 23} {32, 23} {32, 23} + {33, 23} {32, 23} {32, 23} {11, 10} diff --git a/Resources/English.lproj/DBView.strings b/Resources/English.lproj/DBView.strings index 50b5238d..a726b3f5 100644 Binary files a/Resources/English.lproj/DBView.strings and b/Resources/English.lproj/DBView.strings differ 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 -- cgit v1.2.3