finished moving out render_state

This commit is contained in:
2026-01-19 18:00:24 -05:00
parent 79813db3ba
commit 06dd015092
26 changed files with 497 additions and 221 deletions

View File

@@ -1,4 +1,4 @@
use crate::{HasRoot, UiRsc};
use crate::UiRsc;
use super::*;
use std::marker::Unsize;
@@ -22,15 +22,16 @@ pub trait WidgetLike<Rsc: UiRsc, Tag>: Sized {
}
}
fn set_root(self, rsc: &mut Rsc)
where
Rsc: HasRoot,
{
fn set_root(self, rsc: &mut Rsc, root: &mut impl HasRoot) {
let id = self.add_strong(rsc);
rsc.set_root(id);
root.set_root(id);
}
}
pub trait HasRoot {
fn set_root(&mut self, root: StrongWidget);
}
pub trait WidgetArrLike<Rsc, const LEN: usize, Tag> {
#[track_caller]
fn add(self, state: &mut Rsc) -> WidgetArr<LEN>;