pub struct DockArea<'tree, Tab> { /* private fields */ }
Expand description

Displays a DockState in egui.

Implementations§

source§

impl<'tree, Tab> DockArea<'tree, Tab>

source

pub fn show(self, ctx: &Context, tab_viewer: &mut impl TabViewer<Tab = Tab>)

Show the DockArea at the top level.

This is the same as doing:

CentralPanel::default()
    .frame(Frame::central_panel(&ctx.style()).inner_margin(0.))
    .show(ctx, |ui| {
        DockArea::new(&mut tree).show_inside(ui, &mut tab_viewer);
    });

So you can’t use the CentralPanel::show when using DockArea’s one.

See also show_inside.

source

pub fn show_inside( self, ui: &mut Ui, tab_viewer: &mut impl TabViewer<Tab = Tab> )

Shows the docking hierarchy inside a Ui.

See also show.

source§

impl<'tree, Tab> DockArea<'tree, Tab>

source

pub fn new(tree: &'tree mut DockState<Tab>) -> DockArea<'tree, Tab>

Creates a new DockArea from the provided DockState.

source

pub fn id(self, id: Id) -> Self

Sets the DockArea ID. Useful if you have more than one DockArea.

source

pub fn style(self, style: Style) -> Self

Sets the look and feel of the DockArea.

source

pub fn show_add_popup(self, show_add_popup: bool) -> Self

Shows or hides the add button popup. By default it’s false.

source

pub fn show_add_buttons(self, show_add_buttons: bool) -> Self

Shows or hides the tab add buttons. By default it’s false.

source

pub fn show_close_buttons(self, show_close_buttons: bool) -> Self

Shows or hides the tab close buttons. By default it’s true.

source

pub fn tab_context_menus(self, tab_context_menus: bool) -> Self

Whether tabs show a context menu when right-clicked. By default it’s true.

source

pub fn draggable_tabs(self, draggable_tabs: bool) -> Self

Whether tabs can be dragged between nodes and reordered on the tab bar. By default it’s true.

source

pub fn show_tab_name_on_hover(self, show_tab_name_on_hover: bool) -> Self

Whether tabs show their name when hovered over them. By default it’s false.

source

pub fn allowed_splits(self, allowed_splits: AllowedSplits) -> Self

What directions can a node be split in: left-right, top-bottom, all, or none. By default it’s all.

source

pub fn window_bounds(self, bounds: Rect) -> Self

The bounds for any windows inside the DockArea. Defaults to the screen rect. By default it’s set to egui::Context::screen_rect.

source

pub fn show_window_close_buttons(self, show_window_close_buttons: bool) -> Self

Enables or disables the close button on windows. By default it’s true.

source

pub fn show_window_collapse_buttons( self, show_window_collapse_buttons: bool ) -> Self

Enables or disables the collapsing header on windows. By default it’s true.

Trait Implementations§

source§

impl<'tree, Tab> Debug for DockArea<'tree, Tab>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'tree, Tab> Freeze for DockArea<'tree, Tab>

§

impl<'tree, Tab> RefUnwindSafe for DockArea<'tree, Tab>
where Tab: RefUnwindSafe,

§

impl<'tree, Tab> Send for DockArea<'tree, Tab>
where Tab: Send,

§

impl<'tree, Tab> Sync for DockArea<'tree, Tab>
where Tab: Sync,

§

impl<'tree, Tab> Unpin for DockArea<'tree, Tab>

§

impl<'tree, Tab> !UnwindSafe for DockArea<'tree, Tab>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.