Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set keyboard focus reasonably when switching between views.

When you switch to the commit view, the commit message gets focus;
when you switch to the history view, the commit list gets focus.
  • Loading branch information...
commit f2a37df9f5cd16057b505e273882e8f836f500d2 1 parent 7baf854
@nriley nriley authored committed
View
4 PBGitCommitController.m
@@ -47,6 +47,10 @@ - (void) removeView
[webController closeView];
[super finalize];
}
+- (NSResponder *)firstResponder;
+{
+ return commitMessageView;
+}
- (IBAction)signOff:(id)sender
{
View
5 PBGitHistoryController.m
@@ -179,6 +179,11 @@ - (void) updateView
[self refresh:nil];
}
+- (NSResponder *)firstResponder;
+{
+ return commitList;
+}
+
- (void) selectCommit: (NSString*) commit
{
NSPredicate* selection = [NSPredicate predicateWithFormat:@"realSha == %@", commit];
View
1  PBGitWindowController.m
@@ -100,6 +100,7 @@ - (void)changeViewController:(NSInteger)whichViewTag
[self setNextResponder: viewController];
[self didChangeValueForKey:@"viewController"]; // this will trigger the NSTextField's value binding to change
+ [[self window] makeFirstResponder:[viewController firstResponder]];
}
- (void)awakeFromNib
View
2  PBViewController.h
@@ -23,4 +23,6 @@
- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller;
- (void) removeView;
- (void) updateView;
+- (NSResponder *)firstResponder;
+
@end
View
5 PBViewController.m
@@ -40,4 +40,9 @@ - (void) awakeFromNib
- (void) updateView
{
}
+
+- (NSResponder *)firstResponder;
+{
+ return nil;
+}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.