better global state structure?
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user