mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
AccessKit asks for focus by node id, and `Focus::interested_in_focus` only picks the request up once the widget itself runs. Everything that reads the focus before the widget — styling it, for one — therefore saw the old focus, so a text edit was styled unfocused in the very pass it got focused, and lost its focus ring for a frame. A widget in `focus_widgets_cache` has asked for focus in an earlier pass, so it is one we can hand focus to in `begin_pass`, the same way a `request_focus` from the last pass is handed out. Memory then holds the focus before any widget runs, and `Ui::widget_style` needs to know nothing about focus at all. `interested_in_focus` keeps the same grant as a fallback, for the first pass a widget is focusable in, and the two share `take_focus_from_accesskit`. The four `text_edit_*` snapshots gain a caret along with the ring, because the field is now focused for real in that pass rather than a pass later. Also drops `fallback_gap` from `TextEdit`, which has no `gap` of its own to defer to, and moves the `DragValue` `HasClasses` impl above its test module.
4 lines
130 B
Plaintext
4 lines
130 B
Plaintext
version https://git-lfs.github.com/spec/v1
|
|
oid sha256:2ae71de200dfb36f64e1ce95c2ad78ef3c1e88e792ada5b5fa1d8fa8c938d8fd
|
|
size 13806
|