Add support for clicking checkboxes via their labels (#2667)

This commit is contained in:
Keavon Chambers
2025-05-24 04:46:15 -07:00
committed by GitHub
parent 80f38d91c0
commit c4678336e5
13 changed files with 320 additions and 163 deletions
@@ -77,11 +77,13 @@ impl LayoutHolder for NewDocumentDialogMessageHandler {
.widget_holder(),
];
let mut checkbox_id = CheckboxId::default();
let infinite = vec![
TextLabel::new("Infinite Canvas").table_align(true).min_width(90).widget_holder(),
TextLabel::new("Infinite Canvas").table_align(true).min_width(90).for_checkbox(&mut checkbox_id).widget_holder(),
Separator::new(SeparatorType::Unrelated).widget_holder(),
CheckboxInput::new(self.infinite)
.on_update(|checkbox_input: &CheckboxInput| NewDocumentDialogMessage::Infinite(checkbox_input.checked).into())
.for_label(checkbox_id.clone())
.widget_holder(),
];