finished moving out render_state
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user