* claim: #4854 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Sketch palette: the Tie button shows "Tie", not its catalog key (#4854) The button passed the key itself to ui_kit::button with Button::Normal, which draws its label as given; it now passes the translated label. The loose-ends test checks the button by its label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -401,7 +401,8 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
ui.horizontal(|ui| {
|
||||
let text = crate::i18n::format("sketch.untied_ends", &[("count", &untied_ends.to_string())]);
|
||||
ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).on_hover_text(app.tr("ui.untied_ends_tip"));
|
||||
let button = crate::ui_kit::button(ui, "ui.tie_ends", crate::ui_kit::Button::Normal).on_hover_text(app.tr("ui.tie_ends_tip"));
|
||||
let button =
|
||||
crate::ui_kit::button(ui, app.tr("ui.tie_ends"), crate::ui_kit::Button::Normal).on_hover_text(app.tr("ui.tie_ends_tip"));
|
||||
crate::scenario::publish_handle("sketch_palette:tie_ends", button.rect.center());
|
||||
tie = button.clicked();
|
||||
});
|
||||
@@ -794,6 +795,7 @@ mod tests {
|
||||
h.settle();
|
||||
assert!(h.widget("Open 2").is_some(), "the status counts the open ends");
|
||||
assert!(h.widget("Untied 4").is_some(), "the status counts the untied ends");
|
||||
assert!(h.widget("Tie").is_some(), "the Tie button shows its label, not its catalog key");
|
||||
let at = crate::scenario::handle_at("sketch_palette:tie_ends").unwrap();
|
||||
h.call("ui.click", json!({"x": at.x, "y": at.y}));
|
||||
h.settle();
|
||||
|
||||
Reference in New Issue
Block a user