Skip to main content

EditorShell

Trait EditorShell 

pub trait EditorShell: Send + Sync {
    // Required methods
    fn register_panel(
        &mut self,
        location: PanelLocation,
        panel: Box<dyn EditorPanel>,
    );
    fn remove_panel(&mut self, id: &str) -> bool;
    fn set_theme(&mut self, theme: UiTheme);
    fn set_status(&mut self, data: StatusBarData);
    fn set_editor_state(&mut self, state: Arc<Mutex<EditorState>>);
    fn show_frame(&mut self);

    // Provided method
    fn set_fonts(&mut self, fonts: FontPack) { ... }
}
Expand description

The top-level editor shell — a generic host for docked panels.

Concrete implementations live in khora-infra. The engine calls show_frame() once per frame between overlay.begin_frame() and overlay.end_frame_and_render().

Required Methods§

fn register_panel( &mut self, location: PanelLocation, panel: Box<dyn EditorPanel>, )

Registers a panel at the given dock location.

fn remove_panel(&mut self, id: &str) -> bool

Removes a panel by id. Returns true if it was found.

fn set_theme(&mut self, theme: UiTheme)

Applies a theme to the underlying UI backend.

fn set_status(&mut self, data: StatusBarData)

Updates the status bar data shared with panels.

Most editors will route this into a dedicated status-bar panel (the shell does not draw a status bar itself).

fn set_editor_state(&mut self, state: Arc<Mutex<EditorState>>)

Sets a shared EditorState reference. Panels typically grab this at construction; this method exists for shells that want to surface state to internal helpers (debug overlays, etc.).

fn show_frame(&mut self)

Renders the full editor frame.

Iterates every registered slot and invokes EditorPanel::ui for each panel. The shell decides slot geometry; the panel decides slot content.

Provided Methods§

fn set_fonts(&mut self, fonts: FontPack)

Installs a custom font pack. If FontPack::is_empty is true, the backend keeps its built-in defaults. Default no-op so backends that don’t support custom fonts compile without changes.

Implementations on Foreign Types§

Source§

impl EditorShell for EguiEditorShell

Source§

fn register_panel( &mut self, location: PanelLocation, panel: Box<dyn EditorPanel>, )

Source§

fn remove_panel(&mut self, id: &str) -> bool

Source§

fn set_theme(&mut self, theme: UiTheme)

Source§

fn set_fonts(&mut self, fonts: FontPack)

Source§

fn set_status(&mut self, data: StatusBarData)

Source§

fn set_editor_state(&mut self, state: Arc<Mutex<EditorState>>)

Source§

fn show_frame(&mut self)

Implementors§