mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
[qwaq] Improve focus setting
The view is recorded as having focus but is not given focus until the parent view is actually in focus. This fixes the locals view not having focus at startup and thus blocking F7.
This commit is contained in:
parent
b2814700b9
commit
adb7b018d9
1 changed files with 3 additions and 1 deletions
|
@ -97,7 +97,7 @@ trySetFocus (Group *self, int viewIndex)
|
|||
View *view = [self.views objectAtIndex:viewIndex];
|
||||
if (([view state] & (sfDrawn | sfDisabled)) == sfDrawn
|
||||
&& [view options] & ofCanFocus) {
|
||||
if (!self.owner || [self.owner state] & sfInFocus) {
|
||||
if (!self.owner || ([self.owner state] & sfInFocus)) {
|
||||
if (self.focused >= 0) {
|
||||
[[self.views objectAtIndex: self.focused] loseFocus];
|
||||
}
|
||||
|
@ -106,6 +106,8 @@ trySetFocus (Group *self, int viewIndex)
|
|||
self.focused = makeFirst (self, viewIndex);
|
||||
}
|
||||
[view takeFocus];
|
||||
} else {
|
||||
self.focused = viewIndex;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue