strong & weak widgets

This commit is contained in:
2025-12-11 07:16:06 -05:00
parent a85e129026
commit 36668c82f4
19 changed files with 293 additions and 294 deletions

View File

@@ -46,11 +46,11 @@ impl Widgets {
WidgetWrapper::new(data.widget.as_mut(), &mut data.borrowed)
}
pub fn get<I: IdLike>(&self, id: &I) -> Option<&I::Widget> {
pub fn get<I: IdLike>(&self, id: &I) -> Option<&I::Widget> where I::Widget: Sized {
self.get_dyn(id.id())?.as_any().downcast_ref()
}
pub fn get_mut<I: IdLike>(&mut self, id: &I) -> Option<&mut I::Widget> {
pub fn get_mut<I: IdLike>(&mut self, id: &I) -> Option<&mut I::Widget> where I::Widget: Sized {
self.get_dyn_mut(id.id())?.as_any_mut().downcast_mut()
}