mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Fix responder handling in field editor
This commit is contained in:
parent
091da479ac
commit
6d7078e550
File diff suppressed because it is too large
Load Diff
|
@ -845,7 +845,6 @@ static int8_t sSharpAcc[] = {
|
||||||
|
|
||||||
- (void) mouseMoved:(NSEvent *)event
|
- (void) mouseMoved:(NSEvent *)event
|
||||||
{
|
{
|
||||||
NSLog(@"Moved\n");
|
|
||||||
if ([event modifierFlags] & NSAlphaShiftKeyMask)
|
if ([event modifierFlags] & NSAlphaShiftKeyMask)
|
||||||
return; // Keyboard mode, ignore mouse
|
return; // Keyboard mode, ignore mouse
|
||||||
|
|
||||||
|
@ -946,6 +945,15 @@ static int8_t sSharpAcc[] = {
|
||||||
return [[self editTarget] validValue:[fFieldEditor stringValue]];
|
return [[self editTarget] validValue:[fFieldEditor stringValue]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)updateFirstResponder
|
||||||
|
{
|
||||||
|
NSWindow * win = [self window];
|
||||||
|
NSResponder * hasResponder = [win firstResponder];
|
||||||
|
if ([self editTarget])
|
||||||
|
if (hasResponder != [win fieldEditor:NO forObject:nil])
|
||||||
|
[win makeFirstResponder:fFieldEditor];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)controlTextDidEndEditing:(NSNotification *)note
|
- (void)controlTextDidEndEditing:(NSNotification *)note
|
||||||
{
|
{
|
||||||
VLEditable * editable = [self editTarget];
|
VLEditable * editable = [self editTarget];
|
||||||
|
@ -963,9 +971,10 @@ static int8_t sSharpAcc[] = {
|
||||||
[self setEditTarget:editable];
|
[self setEditTarget:editable];
|
||||||
if (editable)
|
if (editable)
|
||||||
[fFieldEditor selectText:self];
|
[fFieldEditor selectText:self];
|
||||||
[[self window] performSelectorOnMainThread:@selector(makeFirstResponder:)
|
else
|
||||||
withObject:(editable ? fFieldEditor : self)
|
[[self window] makeFirstResponder:self];
|
||||||
waitUntilDone:NO];
|
[self performSelectorOnMainThread:@selector(updateFirstResponder)
|
||||||
|
withObject:nil waitUntilDone:NO];
|
||||||
[self setNeedsDisplay: YES];
|
[self setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user