Skip to main content

DockingModel

Trait DockingModel 

Source
pub trait DockingModel: 'static {
    type TabId: Copy + PartialEq + Hash + 'static;
    type PanelId: Copy + PartialEq + 'static;
    type DropValue: Clone + PartialEq + 'static + From<Self::TabId>;

    // Required methods
    fn root(&self) -> Option<&DockNode<Self::TabId, Self::PanelId>>;
    fn on_drop(
        &mut self,
        value: Self::DropValue,
        target: DropTarget<Self::PanelId>,
    ) -> bool;
    fn set_active(
        &mut self,
        panel_id: Self::PanelId,
        tab_id: Self::TabId,
    ) -> bool;
}

Required Associated Types§

Source

type TabId: Copy + PartialEq + Hash + 'static

Id for a tab.

Source

type PanelId: Copy + PartialEq + 'static

Id for a panel.

Source

type DropValue: Clone + PartialEq + 'static + From<Self::TabId>

The value carried by a drag-and-drop.

Required Methods§

Source

fn root(&self) -> Option<&DockNode<Self::TabId, Self::PanelId>>

The current tree of panels and splits, or None when it’s empty.

Source

fn on_drop( &mut self, value: Self::DropValue, target: DropTarget<Self::PanelId>, ) -> bool

Apply a dropped Self::DropValue at target. Returns true if something changed.

Source

fn set_active(&mut self, panel_id: Self::PanelId, tab_id: Self::TabId) -> bool

Make tab_id the active one in panel_id. Returns true if it was found.

Implementors§