Use slider toggles for boolean controls

This commit is contained in:
Georg Bauer
2026-07-28 18:38:30 +02:00
parent 9cf1c70a67
commit 00af0335ff
5 changed files with 28 additions and 23 deletions

View File

@@ -495,10 +495,10 @@ impl App {
&surface.data,
context,
));
let checkbox = checkbox(checked).label(label);
let control = toggle(checked).label(label);
if let Some(path) = local_path(binding_path(binding), context_path.as_deref()) {
let surface_id = surface.id.clone();
checkbox
control
.on_toggle(move |value| {
Message::A2uiDataChanged(
surface_id.clone(),
@@ -508,7 +508,7 @@ impl App {
})
.into()
} else {
checkbox.into()
control.into()
}
}
"Slider" => {
@@ -617,7 +617,7 @@ impl App {
}
chips = chips.push(choice);
} else if multiple {
let mut choice = checkbox(is_selected).label(label);
let mut choice = toggle(is_selected).label(label);
if let Some(path) = path.clone() {
let surface_id = surface.id.clone();
let option_value = option_value.clone();