Actaully previous way was correct, event handlers on parent
This commit is contained in:
parent
302f3cb6e3
commit
75504ec4fc
|
@ -80,12 +80,12 @@ fn SceneTree<'a>(cx: Scope, selected_entity: &'a UseState<Option<Entity>>) -> El
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node {
|
node {
|
||||||
|
onclick: move |_| spawn_entity(),
|
||||||
|
onmouse_enter: enter,
|
||||||
|
onmouse_exit: exit,
|
||||||
padding: "8",
|
padding: "8",
|
||||||
background_color: if spawn_entity_hovered { NEUTRAL_600 } else { NEUTRAL_800 },
|
background_color: if spawn_entity_hovered { NEUTRAL_600 } else { NEUTRAL_800 },
|
||||||
text {
|
text {
|
||||||
onclick: move |_| spawn_entity(),
|
|
||||||
onmouse_enter: enter,
|
|
||||||
onmouse_exit: exit,
|
|
||||||
text: "Spawn Entity",
|
text: "Spawn Entity",
|
||||||
text_size: "18"
|
text_size: "18"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue