finally fixed style merging

This commit is contained in:
2024-12-17 11:11:55 +01:00
parent f753a27bbc
commit 317542097c
7 changed files with 137 additions and 122 deletions
+4 -5
View File
@@ -39,11 +39,6 @@ impl ElementWidget for Div<'_> {
}
fn event(&mut self, event: Event, document: &Document) {
if event == Event::FocusGained {
if let Some(styling) = self.styling.clone() {
self.set_styling(&styling);
}
}
if let (Some((child, i)), l) = self.children.get_child_idx() {
match event {
Event::Key(k) => match k.code {
@@ -78,6 +73,7 @@ impl ElementWidget for Div<'_> {
#[derive(Default, Debug)]
pub struct Button {
pub on_click: Handler<Button<'a>>,
pub on_hover: Handler<Button<'a>>,
}
impl ElementWidget for Button<'_> {
@@ -97,6 +93,9 @@ impl ElementWidget for Button<'_> {
self.style.set_state("");
}
}
Event::FocusGained => {
call!(self.on_hover(event, document));
}
_ => {}
}
}