aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoritesOutlineView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFavoritesOutlineView.m')
-rw-r--r--Source/SPFavoritesOutlineView.m21
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];