Trait EditorPanel
pub trait EditorPanel: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn title(&self) -> &str;
fn ui(&mut self, ui: &mut dyn UiBuilder);
// Provided method
fn preferred_size(&self) -> Option<f32> { ... }
}Expand description
A single editor panel that can render itself into a UiBuilder.
Panels are registered with an EditorShell at
startup. The shell calls ui() each frame for every visible
panel.
Required Methods§
Provided Methods§
fn preferred_size(&self) -> Option<f32>
fn preferred_size(&self) -> Option<f32>
Preferred size hint, in logical points.
Interpretation depends on the panel’s PanelLocation:
| Location | Meaning |
|---|---|
TopBar, StatusBar | Fixed height. |
Spine | Fixed width. |
Left, Right | Default width (still resizable by user). |
Bottom | Default height (still resizable by user). |
Center, Floating | Ignored. |
Returning None lets the shell pick a sensible default for the slot.