From ea1516eeb991cedd2ea8d86d65fef4b102996b2b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 23 Jul 2012 00:35:01 +0000 Subject: - Add a new SPSplitView class, intended to replace all BWSplitViews and so allow us to remove BWToolKit. Supports constraints and animated collapsible subviews configured in code, fixes crashes and exceptions if a window is closed while animations are taking place or scheduled to take place. - Replace the two vertical splitters in the table list (the filter splitter, and the table info splitter) with SPSplitView implementations as a test - Add a helper method in the new SPDateAdditions --- Source/SPDatabaseDocument.m | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 5f7cb49a..0cfec364 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -528,10 +528,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; // Set focus to table list filter field if visible // otherwise set focus to Table List view - if ([[tablesListInstance tables] count] > 20) - [parentWindow makeFirstResponder:listFilterField]; - else - [parentWindow makeFirstResponder:[tablesListInstance valueForKeyPath:@"tablesListView"]]; + [self focusOnTableListFilter:self]; if (spfSession != nil) { @@ -2296,7 +2293,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; */ - (IBAction)focusOnTableListFilter:(id)sender { - [tablesListInstance performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.1]; + [[tablesListInstance onMainThread] performSelector:@selector(makeTableListFilterHaveFocus) withObject:nil afterDelay:0.25]; } /** @@ -5575,13 +5572,6 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; #pragma mark - #pragma mark SplitView delegate methods #ifndef SP_REFACTOR /* SplitView delegate methods */ -/** - * tells the splitView that it can collapse views - */ -- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview -{ - return subview == [[tableInfoTable superview] superview]; -} - (void)splitViewDidResizeSubviews:(NSNotification *)notification { @@ -6071,12 +6061,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; // Set focus to table list filter field if visible // otherwise set focus to Table List view - if ([[tablesListInstance tables] count] > 20) { - [[parentWindow onMainThread] makeFirstResponder:listFilterField]; - } - else { - [[parentWindow onMainThread] makeFirstResponder:[tablesListInstance valueForKeyPath:@"tablesListView"]]; - } + [self focusOnTableListFilter:self]; #endif } -- cgit v1.2.3