diff options
author | rowanbeentje <rowan@beent.je> | 2013-02-21 00:50:15 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-02-21 00:50:15 +0000 |
commit | 77b2f3d777bc743b7b96a9f2267d1a89d704510d (patch) | |
tree | 36a5a2b9369b696a280e9ca6ad1e195e8f74de44 /Source/SPFavoritesOutlineView.m | |
parent | 9aaa544772539410f28df132be78e0f44da1db10 (diff) | |
download | sequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.tar.gz sequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.tar.bz2 sequelpro-77b2f3d777bc743b7b96a9f2267d1a89d704510d.zip |
- When favorites in the connection view gave no password, no longer set the focus to the password field as soon as they're selected; instead, make the password field the next responder for tab keys. This addresses Issue #1555.
Diffstat (limited to 'Source/SPFavoritesOutlineView.m')
-rw-r--r-- | Source/SPFavoritesOutlineView.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/SPFavoritesOutlineView.m b/Source/SPFavoritesOutlineView.m index f4fc3a7a..6972309b 100644 --- a/Source/SPFavoritesOutlineView.m +++ b/Source/SPFavoritesOutlineView.m @@ -37,6 +37,8 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; @implementation SPFavoritesOutlineView +@synthesize justGainedFocus; + - (void) awakeFromNib { systemVersion = 0; @@ -45,9 +47,19 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; - (BOOL)acceptsFirstResponder { + if ([[self window] firstResponder] != self) { + [self setJustGainedFocus:YES]; + } + return YES; } +- (BOOL)resignFirstResponder +{ + [self setJustGainedFocus:NO]; + return [super resignFirstResponder];; +} + /** * Right-click at row will select that row before ordering out the contextual menu * if not more than one row is selected. @@ -76,6 +88,15 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; [[self delegate] performSelector:[self doubleAction]]; return; + + // If the Tab key is used, change focus rather than entering edit mode. + } else if ([[event characters] length] && [[event characters] characterAtIndex:0] == NSTabCharacter) { + if (([event modifierFlags] & NSShiftKeyMask) != NSShiftKeyMask) { + [[self window] selectKeyViewFollowingView:self]; + } else { + [[self window] selectKeyViewPrecedingView:self]; + } + return; } [super keyDown:event]; |