Skip to main content

EditorPanel

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§

fn id(&self) -> &str

Unique identifier (used for dock serialization and lookup).

fn title(&self) -> &str

Human-readable title shown in the tab / panel header.

fn ui(&mut self, ui: &mut dyn UiBuilder)

Build the panel contents for the current frame.

Provided Methods§

fn preferred_size(&self) -> Option<f32>

Preferred size hint, in logical points.

Interpretation depends on the panel’s PanelLocation:

LocationMeaning
TopBar, StatusBarFixed height.
SpineFixed width.
Left, RightDefault width (still resizable by user).
BottomDefault height (still resizable by user).
Center, FloatingIgnored.

Returning None lets the shell pick a sensible default for the slot.

Implementors§