mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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.
This commit is contained in:
committed by
Pieter de Bie
parent
7baf854666
commit
f2a37df9f5
@@ -47,6 +47,10 @@
|
||||
[webController closeView];
|
||||
[super finalize];
|
||||
}
|
||||
- (NSResponder *)firstResponder;
|
||||
{
|
||||
return commitMessageView;
|
||||
}
|
||||
|
||||
- (IBAction)signOff:(id)sender
|
||||
{
|
||||
|
||||
@@ -179,6 +179,11 @@
|
||||
[self refresh:nil];
|
||||
}
|
||||
|
||||
- (NSResponder *)firstResponder;
|
||||
{
|
||||
return commitList;
|
||||
}
|
||||
|
||||
- (void) selectCommit: (NSString*) commit
|
||||
{
|
||||
NSPredicate* selection = [NSPredicate predicateWithFormat:@"realSha == %@", commit];
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
[self setNextResponder: viewController];
|
||||
[self didChangeValueForKey:@"viewController"]; // this will trigger the NSTextField's value binding to change
|
||||
|
||||
[[self window] makeFirstResponder:[viewController firstResponder]];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
|
||||
@@ -23,4 +23,6 @@
|
||||
- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller;
|
||||
- (void) removeView;
|
||||
- (void) updateView;
|
||||
- (NSResponder *)firstResponder;
|
||||
|
||||
@end
|
||||
|
||||
@@ -40,4 +40,9 @@
|
||||
- (void) updateView
|
||||
{
|
||||
}
|
||||
|
||||
- (NSResponder *)firstResponder;
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user