aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionControllerInitializer.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-10 00:15:32 +0000
committerrowanbeentje <rowan@beent.je>2012-05-10 00:15:32 +0000
commit874a0b71c468118ca1337d61d93f84455cd7f65b (patch)
tree4628c477ec594d3a57898ff8386c8692fe346b62 /Source/SPConnectionControllerInitializer.m
parentcb23c164e9cdd7b235a7c00535fbb0f3de503aaf (diff)
downloadsequelpro-874a0b71c468118ca1337d61d93f84455cd7f65b.tar.gz
sequelpro-874a0b71c468118ca1337d61d93f84455cd7f65b.tar.bz2
sequelpro-874a0b71c468118ca1337d61d93f84455cd7f65b.zip
- Ensure the selected connection is correctly scrolled to on Lion, working around animation issues
Diffstat (limited to 'Source/SPConnectionControllerInitializer.m')
-rw-r--r--Source/SPConnectionControllerInitializer.m11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/SPConnectionControllerInitializer.m b/Source/SPConnectionControllerInitializer.m
index 7bafe157..ee805594 100644
--- a/Source/SPConnectionControllerInitializer.m
+++ b/Source/SPConnectionControllerInitializer.m
@@ -104,8 +104,13 @@ static NSString *SPConnectionViewNibName = @"ConnectionView";
// Update the UI
[self _reloadFavoritesViewData];
[self setUpFavoritesOutlineView];
- [self setUpSelectedConnectionFavorite];
[self _restoreOutlineViewStateNode:favoritesRoot];
+
+ // Set up the selected favourite, and scroll after a small delay to fix animation delay on Lion
+ [self setUpSelectedConnectionFavorite];
+ if ([favoritesOutlineView selectedRow] != -1) {
+ [self performSelector:@selector(_scrollToSelectedNode) withObject:nil afterDelay:0.0];
+ }
// Set sort items
currentSortItem = [prefs integerForKey:SPFavoritesSortedBy];
@@ -262,8 +267,8 @@ static NSString *SPConnectionViewNibName = @"ConnectionView";
[self _selectNode:favorite];
[self resizeTabViewToConnectionType:[[[[favorite representedObject] nodeFavorite] objectForKey:SPFavoriteTypeKey] integerValue] animating:NO];
-
- [favoritesOutlineView scrollRowToVisible:[favoritesOutlineView selectedRow]];
+
+ [self _scrollToSelectedNode];
}
else {
previousType = SPTCPIPConnection;