we love post fix

This commit is contained in:
2025-09-20 13:42:47 -04:00
parent 3653f24e06
commit 20b044865c
2 changed files with 13 additions and 7 deletions

View File

@@ -33,6 +33,12 @@ pub trait WidgetLike<Ctx, Tag> {
{
self.add(ui).into_static()
}
fn set_root(self, ui: &mut Ui<Ctx>)
where
Self: Sized,
{
ui.set_root(self);
}
}
/// A function that returns a widget given a UI.

View File

@@ -183,13 +183,13 @@ impl Client {
let info = text("").add(&mut ui);
let info_sect = info.clone().pad(10).align(Align::BotLeft);
ui.set_root(
(
(tabs, main).span(Dir::DOWN, [fixed(40), ratio(1)]),
info_sect,
)
.stack(),
);
(
(tabs, main).span(Dir::DOWN, [fixed(40), ratio(1)]),
info_sect,
)
.stack()
.set_root(&mut ui);
Self {
renderer,