pub struct Ui { /* private fields */ }Expand description
A type erased Ui
Implementations§
Source§impl Ui
impl Ui
Sourcepub fn new_dyn_spawned(
&self,
file_path: Option<&Path>,
spawn_id: SpawnId,
specs: DynSpawnSpecs,
win: usize,
) -> RwArea
pub fn new_dyn_spawned( &self, file_path: Option<&Path>, spawn_id: SpawnId, specs: DynSpawnSpecs, win: usize, ) -> RwArea
Initiates and returns a new “dynamic spawned” RwArea
This is one of three ways of spawning floating Widgets.
Another is with RawArea::spawn, in which a Widget will
be bolted on the edges of another. Another one is through
RawUi::new_static_spawned.
Sourcepub fn new_static_spawned(
&self,
file_path: Option<&Path>,
spawn_id: SpawnId,
specs: StaticSpawnSpecs,
win: usize,
) -> RwArea
pub fn new_static_spawned( &self, file_path: Option<&Path>, spawn_id: SpawnId, specs: StaticSpawnSpecs, win: usize, ) -> RwArea
Initiates and returns a new “static spawned” RawArea
This is one of three ways of spawning floating Widgets.
Another is with RawArea::spawn, in which a Widget will
be bolted on the edges of another. Another one is through
RawUi::new_dyn_spawned.
Sourcepub fn switch_window(&self, win: usize)
pub fn switch_window(&self, win: usize)
Switches the currently active window
This will only happen to with window indices that are actual windows. If at some point, a window index comes up that is not actually a window, that’s a bug.
Sourcepub fn flush_layout(&self)
pub fn flush_layout(&self)
Flush the layout
When this function is called, it means that Duat has finished adding or removing widgets, so the ui should calculate the layout.
Sourcepub fn print(&self)
pub fn print(&self)
Prints the layout
Since printing runs all on the same thread, it is most efficient to call a printing function after all the widgets are done updating, I think.
Sourcepub fn unload(&self)
pub fn unload(&self)
Unloads the RawUi
Unlike RawUi::close, this will happen both when Duat
reloads the configuratio and when it closes the app.
These will happen inside of the dynamically loaded config crate.
Sourcepub fn remove_window(&self, win: usize)
pub fn remove_window(&self, win: usize)
Removes a window from the RawUi
This should keep the current active window consistent. That is, if the current window was ahead of the deleted one, it should be shifted back, so that the same window is still displayed.