forked from StudioInfinity/dyna3
chore: wrap all code at 80 characters
This commit is contained in:
parent
6c3a48fb52
commit
4a3f47c8b5
7 changed files with 311 additions and 150 deletions
|
|
@ -63,8 +63,10 @@ fn RegulatorInput(regulator: Rc<dyn Regulator>) -> View {
|
|||
placeholder = measurement.with(|result| result.to_string()),
|
||||
bind:value = value,
|
||||
on:change = move |_| {
|
||||
let specification =
|
||||
SpecifiedValue::try_from(value.get_clone_untracked());
|
||||
valid.set(
|
||||
match SpecifiedValue::try_from(value.get_clone_untracked()) {
|
||||
match specification {
|
||||
Ok(set_pt) => {
|
||||
set_point.set(set_pt);
|
||||
true
|
||||
|
|
@ -141,7 +143,9 @@ fn ElementOutlineItem(element: Rc<dyn Element>) -> View {
|
|||
let class = {
|
||||
let element_for_class = element.clone();
|
||||
state.selection.map(
|
||||
move |sel| if sel.contains(&element_for_class) { "selected" } else { "" }
|
||||
move |sel|
|
||||
if sel.contains(&element_for_class) { "selected" }
|
||||
else { "" }
|
||||
)
|
||||
};
|
||||
let label = element.label().clone();
|
||||
|
|
@ -175,7 +179,8 @@ fn ElementOutlineItem(element: Rc<dyn Element>) -> View {
|
|||
move |event: KeyboardEvent| {
|
||||
match event.key().as_str() {
|
||||
"Enter" => {
|
||||
state.select(&element_for_handler, event.shift_key());
|
||||
state.select(&element_for_handler,
|
||||
event.shift_key());
|
||||
event.prevent_default();
|
||||
},
|
||||
"ArrowRight" if regulated.get() => {
|
||||
|
|
@ -205,18 +210,22 @@ fn ElementOutlineItem(element: Rc<dyn Element>) -> View {
|
|||
let state_for_handler = state.clone();
|
||||
let element_for_handler = element.clone();
|
||||
move |event: MouseEvent| {
|
||||
state_for_handler.select(&element_for_handler, event.shift_key());
|
||||
state_for_handler.select(&element_for_handler,
|
||||
event.shift_key());
|
||||
event.stop_propagation();
|
||||
event.prevent_default();
|
||||
}
|
||||
}
|
||||
) {
|
||||
div(class = "element-label") { (label) }
|
||||
div(class = "element-representation") { (rep_components) }
|
||||
div(class = "element-representation") {
|
||||
(rep_components)
|
||||
}
|
||||
input(
|
||||
r#type = "checkbox",
|
||||
bind:checked = element.ghost(),
|
||||
on:click = |event: MouseEvent| event.stop_propagation()
|
||||
on:click =
|
||||
|event: MouseEvent| event.stop_propagation()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue