state management as a child

This commit is contained in:
2025-07-29 17:51:03 +02:00
parent de9039dbaf
commit db66803347
5 changed files with 19 additions and 4 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};
use crate::widget::{Element, Widget};
use crate::{widget::{Element, Widget}, NoRender};
pub struct FlexRow {
color: u32,
@@ -55,6 +55,7 @@ impl Element for FlexRow {
fn draw_child(&self, element: &Arc<Widget>) {
self.children.lock().unwrap().push(element.clone());
element.inject(|w| w.component(NoRender));
}
fn as_any(&self) -> &dyn std::any::Any {
@@ -116,6 +117,7 @@ impl Element for FlexCol {
fn draw_child(&self, element: &Arc<Widget>) {
self.children.lock().unwrap().push(element.clone());
element.inject(|w| w.component(NoRender));
}
fn as_any(&self) -> &dyn std::any::Any {