Fix OK lost while a joint animates; Browser Joints folder inside the root component
Clicking OK during the Joint dialog's motion animation was lost about half the time: the preview's busy spinner came and went in the dialog footer between frames, shifting the automatic ids of OK and Cancel, so a click pressed in one frame and released in the next landed on two different ids. The spinner's place is now always taken. Reproduced through the control channel (6 of 14 OK clicks at different animation phases lost before, 0 of 14 after) and covered by a test that presses OK with the preview busy and releases it once idle. The Joints folder is drawn by component_rows for the root, after its folders (as agreed with solvecraft-shell). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
bdc15d2204
commit
62dbf60eb2
4 files changed
+53
-5
No files matched your search
@@ -1386,8 +1386,13 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
ui.painter().circle_stroke(r.center(), 7.0, Stroke::new(1.2, t.text_dim));
|
||||
ui.painter().text(r.center(), egui::Align2::CENTER_CENTER, "i", egui::FontId::proportional(11.0), t.text_dim);
|
||||
resp.on_hover_text(heading.as_str());
|
||||
// The spinner's place is always taken: a widget that comes and goes would shift
|
||||
// the automatic ids of OK and Cancel, and a click pressed in one frame and
|
||||
// released in the next would be lost (an animating preview toggles it often).
|
||||
let (sr, sresp) = ui.allocate_exact_size(vec2(14.0, 14.0), egui::Sense::hover());
|
||||
if app.preview.busy {
|
||||
ui.add(egui::Spinner::new().size(14.0)).on_hover_text("Updating the preview");
|
||||
egui::Spinner::new().size(14.0).paint_at(ui, sr);
|
||||
sresp.on_hover_text("Updating the preview");
|
||||
}
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
let close = if matches!(d.kind, Kind::Params { .. } | Kind::Measure { .. } | Kind::Preferences) { "Close" } else { "Cancel" };
|
||||
|
||||
Reference in new issue
Block a user