First focusable widget now focused on window initial paint.
This commit is contained in:
parent
bf71916462
commit
69865a54f6
1 changed files with 10 additions and 0 deletions
|
|
@ -614,6 +614,16 @@ void widgetOnPaint(WindowT *win, RectT *dirtyArea) {
|
||||||
widgetLayoutChildren(root, &ctx->font);
|
widgetLayoutChildren(root, &ctx->font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Auto-focus first focusable widget if nothing has focus yet
|
||||||
|
if (!sFocusedWidget) {
|
||||||
|
WidgetT *first = widgetFindNextFocusable(root, NULL);
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
first->focused = true;
|
||||||
|
sFocusedWidget = first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Paint widget tree (clip rect limits drawing to visible area)
|
// Paint widget tree (clip rect limits drawing to visible area)
|
||||||
wgtPaint(root, &cd, &ctx->blitOps, &ctx->font, &ctx->colors);
|
wgtPaint(root, &cd, &ctx->blitOps, &ctx->font, &ctx->colors);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue