Make checkboxes not use interior mutability (#2976)

* Make checkboxes not use interior mutability

* Use copy instead of cloning

* Fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Timon
2025-08-03 15:16:21 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent 7fcdad1f88
commit 8fad295e36
9 changed files with 76 additions and 111 deletions
@@ -236,7 +236,7 @@ impl LayoutHolder for PathTool {
})
// TODO: Remove `unwrap_or_default` once checkboxes are capable of displaying a mixed state
.unwrap_or_default();
let mut checkbox_id = CheckboxId::default();
let checkbox_id = CheckboxId::new();
let colinear_handle_checkbox = CheckboxInput::new(colinear_handles_state)
.disabled(!self.tool_data.can_toggle_colinearity)
.on_update(|&CheckboxInput { checked, .. }| {
@@ -247,12 +247,12 @@ impl LayoutHolder for PathTool {
}
})
.tooltip(colinear_handles_tooltip)
.for_label(checkbox_id.clone())
.for_label(checkbox_id)
.widget_holder();
let colinear_handles_label = TextLabel::new("Colinear Handles")
.disabled(!self.tool_data.can_toggle_colinearity)
.tooltip(colinear_handles_tooltip)
.for_checkbox(&mut checkbox_id)
.for_checkbox(checkbox_id)
.widget_holder();
let point_editing_mode = CheckboxInput::new(self.options.path_editing_mode.point_editing_mode)