sizing actually working correctly now

This commit is contained in:
2025-09-16 17:31:54 -04:00
parent b48acccb8d
commit f9097807a2
17 changed files with 333 additions and 194 deletions

View File

@@ -66,6 +66,10 @@ impl<Ctx> Ui<Ctx> {
self.widgets.data_mut(&id.id).unwrap().label = label;
}
pub fn label<W>(&self, id: &WidgetId<W>) -> &String {
&self.widgets.data(&id.id).unwrap().label
}
pub fn add_widget<W: Widget>(&mut self, w: W) -> WidgetId<W> {
self.push(w)
}
@@ -281,6 +285,10 @@ impl Widgets {
self.map.get(id)
}
pub fn label(&self, id: &Id) -> &String {
&self.data(id).unwrap().label
}
pub fn data_mut(&mut self, id: &Id) -> Option<&mut WidgetData> {
self.map.get_mut(id)
}