better global state structure?

This commit is contained in:
2025-12-19 21:54:48 -05:00
parent 30bc55c78e
commit bae17235c6
23 changed files with 335 additions and 230 deletions

View File

@@ -42,9 +42,25 @@ pub struct Ui {
resized: bool,
}
pub trait HasUi: Sized + 'static {
fn ui_ref(&self) -> &Ui;
fn ui(&mut self) -> &mut Ui;
pub trait HasUi: Sized {
fn get(&self) -> &Ui;
fn get_mut(&mut self) -> &mut Ui;
fn ui(&self) -> &Ui {
self.get()
}
fn ui_mut(&mut self) -> &mut Ui {
self.get_mut()
}
}
impl HasUi for Ui {
fn get(&self) -> &Ui {
self
}
fn get_mut(&mut self) -> &mut Ui {
self
}
}
impl Ui {