This commit is contained in:
iris committed 2025-08-10 19:10:26 -04:00
1 parent 577d62b1da
commit 848347e6b3
4 files changed
+17 -19

No files matched your search

+6 -2
View File
@@ -31,8 +31,12 @@ impl From<UI> for UIBuilder {
}
impl UIBuilder {
pub fn add<W: Widget>(&mut self, w: W) -> WidgetRef<W> {
WidgetRef::new(self.clone(), [self.push(w)])
pub fn add<W: Widget>(&mut self, w: impl WidgetLike<Widget = W>) -> WidgetRef<W> {
WidgetRef::new([w.add(self).erase_type()])
}
pub fn add_widget<W: Widget>(&mut self, w: W) -> WidgetRef<W> {
WidgetRef::new([self.push(w)])
}
pub fn push<W: Widget>(&mut self, w: W) -> WidgetId {