UI: clicking into a value or inline text field selects all of it (#170)
Cause: the click-to-edit fields (hot numbers and revolutions, the Timeline time display and layer comments, Project rename/comment, the Render Queue output path, Essential Graphics control names) opened a text edit with egui's default caret at the end of the text, so typing appended to the old value. The Timeline time display, layer comment and Essential Graphics name editors also re-requested focus before checking `lost_focus()`, which hid the loss, so Enter, Escape and clicking away never closed them. Fix: a shared `widgets::keep_focus` keeps an open inline editor focused and selects its whole text on the frame it opens (`widgets::select_all`, which the layer rename now reuses). Those editors check for a lost focus first, and Escape now cancels in the time display and the Essential Graphics name editor. Test: ui_angles `typing_replaces_the_clicked_value` (degrees and revolutions in Effect Controls, Timeline and Properties, typed without Ctrl+A); ui_inline_edit `project_rename_replaces_the_name` and `timecode_field_replaces_commits_and_cancels`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6e2f0d9682
commit
bcf5f32d9b
@@ -715,7 +715,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
}
|
||||
editing = None;
|
||||
} else {
|
||||
resp.request_focus();
|
||||
widgets::keep_focus(ui.ctx(), &resp, &buf);
|
||||
editing = Some((it.id, buf));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user