Fix #322: the value field draws in a child UI and leaves the slider rows in place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01912WaK6Rmew3wxZuPyX7E8
This commit is contained in:
Claude 2026-10-08 18:22:43 +00:00
parent 0fbf20db51
commit acc85c4147
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -201,7 +201,9 @@ pub fn slider(ui: &mut Ui, spec: &ControlSpec, value: f64, enabled: bool, label_
.horizontal_align(egui::Align::RIGHT)
.desired_width(value_rect.width())
.margin(egui::Margin::ZERO);
let te = ui.put(value_rect, field);
// a child over the value, so the field never moves the rows around it
let mut child = ui.new_child(egui::UiBuilder::new().max_rect(value_rect).layout(egui::Layout::right_to_left(egui::Align::Center)));
let te = child.add(field);
if frames < 2 {
te.request_focus();
// the old value is selected, so typing replaces it (set again once the field has the