Module splitter

Module splitter 

Source
Expand description

Vertical or horizontal multiple split.

use rat_widget::splitter::{Split, SplitState, SplitType};

let split = Split::horizontal()
    .constraints([
        Constraint::Length(25),
        Constraint::Length(25),
        Constraint::Fill(1),
    ])
    .split_type(SplitType::Scroll)
    .into_widget(area, &mut state.split);

Line::from("first")
    .render(state.split.widget_areas[0], buf);

Line::from("second")
    .render(state.split.widget_areas[1], buf);

Line::from("third")
    .render(state.split.widget_areas[2], buf);

// render split decorations
split.render(area, buf, &mut state.split);

Structs§

LayoutWidget
Widget for the Layout of the split.
Split
Splits the area in multiple parts and renders a UI that allows changing the sizes.
SplitState
State & event handling.
SplitStyle
Combined styles for the Split.
SplitWidget
Primary widget for rendering the Split.

Enums§

ResizeConstraint
How will one split area be resized when resizing the whole split-widget.
SplitResize
Strategy for resizing the split-areas.
SplitType
Render variants for the splitter.

Functions§

handle_events
Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
handle_mouse_events
Handle only mouse-events.