beginning actual app
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
layout::{StaticWidgetId, Widget, WidgetId},
|
||||
layout::{IdLike, Widget},
|
||||
util::{DynBorrower, HashMap, Id, IdTracker},
|
||||
};
|
||||
|
||||
@@ -47,20 +47,12 @@ impl Widgets {
|
||||
WidgetWrapper::new(data.widget.as_mut(), &mut data.borrowed)
|
||||
}
|
||||
|
||||
pub fn get_static<W: Widget>(&self, id: &StaticWidgetId<W>) -> Option<&W> {
|
||||
self.get_dyn(id.id)?.as_any().downcast_ref()
|
||||
pub fn get<W: Widget>(&self, id: &impl IdLike<W>) -> Option<&W> {
|
||||
self.get_dyn(id.id())?.as_any().downcast_ref()
|
||||
}
|
||||
|
||||
pub fn get_static_mut<W: Widget>(&mut self, id: &StaticWidgetId<W>) -> Option<&mut W> {
|
||||
self.get_dyn_mut(id.id)?.as_any_mut().downcast_mut()
|
||||
}
|
||||
|
||||
pub fn get<W: Widget>(&self, id: &WidgetId<W>) -> Option<&W> {
|
||||
self.get_dyn(id.id)?.as_any().downcast_ref()
|
||||
}
|
||||
|
||||
pub fn get_mut<W: Widget>(&mut self, id: &WidgetId<W>) -> Option<&mut W> {
|
||||
self.get_dyn_mut(id.id)?.as_any_mut().downcast_mut()
|
||||
pub fn get_mut<W: Widget>(&mut self, id: &impl IdLike<W>) -> Option<&mut W> {
|
||||
self.get_dyn_mut(id.id())?.as_any_mut().downcast_mut()
|
||||
}
|
||||
|
||||
pub fn insert<W: Widget>(&mut self, id: Id, widget: W) {
|
||||
|
||||
Reference in New Issue
Block a user