Skip to main content

Module split_pane

Module split_pane 

Source
Available on crate feature split-pane only.
Expand description

Two views, a start and an end, with one handle between them.

A split pane is a resizable panel group of exactly two panels, described by one ratio: the start view’s share of the space. State wraps the group’s state and speaks in that ratio, and the view is the same widget, so dragging, keyboard resizing, collapsing and stacking on narrow screens all behave identically. The events, outputs, Actions and default_keymap are the resizable panel’s.

Re-exports§

pub use crate::layout::resizable_panel::Action;
pub use crate::layout::resizable_panel::Axis;
pub use crate::layout::resizable_panel::Event;
pub use crate::layout::resizable_panel::Extent;
pub use crate::layout::resizable_panel::Output;
pub use crate::layout::resizable_panel::default_keymap;

Structs§

SplitPane
A split pane builder. Convert it into an Element to render.
State
The start view’s share of the space and the two panels’ limits.

Functions§

ratio_of
The start panel’s share of sizes, or an even split when there is nothing to go on.
split_pane
Shows start and end with a handle between them, side by side unless the axis says otherwise. Without on_event the handle does nothing.