diff --git a/app-proto/main.css b/app-proto/main.css index a687aac..bdbacfb 100644 --- a/app-proto/main.css +++ b/app-proto/main.css @@ -104,6 +104,10 @@ details[open]:has(li) .elt-switch::after { font-style: italic; } +.cst > input { + margin: 0px 8px 0px 0px; +} + /* display */ canvas { diff --git a/app-proto/src/add_remove.rs b/app-proto/src/add_remove.rs index 40b0e98..ab5db70 100644 --- a/app-proto/src/add_remove.rs +++ b/app-proto/src/add_remove.rs @@ -66,7 +66,8 @@ fn load_gen_assemb(assembly: &Assembly) { assembly.elements_by_id.with_untracked(|elts_by_id| elts_by_id["gemini_a"]), assembly.elements_by_id.with_untracked(|elts_by_id| elts_by_id["gemini_b"]) ), - rep: 0.5 + rep: 0.5, + active: create_signal(true) } ); } @@ -211,7 +212,8 @@ pub fn AddRemove() -> View { ); state.assembly.insert_constraint(Constraint { args: args, - rep: 0.0 + rep: 0.0, + active: create_signal(true) }); state.selection.update(|sel| sel.clear()); diff --git a/app-proto/src/assembly.rs b/app-proto/src/assembly.rs index c0c9959..e8dab79 100644 --- a/app-proto/src/assembly.rs +++ b/app-proto/src/assembly.rs @@ -16,7 +16,8 @@ pub struct Element { #[derive(Clone)] pub struct Constraint { pub args: (usize, usize), - pub rep: f64 + pub rep: f64, + pub active: Signal } // a complete, view-independent description of an assembly diff --git a/app-proto/src/outline.rs b/app-proto/src/outline.rs index c980887..4e4de9c 100644 --- a/app-proto/src/outline.rs +++ b/app-proto/src/outline.rs @@ -136,6 +136,7 @@ pub fn Outline() -> View { let other_arg_label = assembly.elements.with(|elts| elts[other_arg].label.clone()); view! { li(class="cst") { + input(r#type="checkbox", bind:checked=cst.active) div(class="cst-label") { (other_arg_label) } div(class="cst-rep") { (cst.rep) } }