Struct rat_widget::splitter::Split
source · pub struct Split<'a> { /* private fields */ }Expand description
Splits the area in multiple parts and allows changing the sizes.
This widget doesn’t hold a reference to the rendered widgets or such, use [SplitState::areas] to render each part, after rendering the split widget.
Additionally, Split itself can’t be rendered but acts as a builder
for the actual widgets. Call into_widgets to get the actual
SplitWidget and the SplitOverlay. SplitWidget must be rendered
first, after that you can access the SplitState::areas to render the
parts, and last render SplitOverlay to render the markers that will
appear overlaid on the widgets.
Implementations§
source§impl<'a> Split<'a>
impl<'a> Split<'a>
pub fn new() -> Self
sourcepub fn constraints(
self,
constraints: impl IntoIterator<Item = Constraint>,
) -> Self
pub fn constraints( self, constraints: impl IntoIterator<Item = Constraint>, ) -> Self
Set constraints for the initial area sizes. If the window is resized the current widths are used as constraints for recalculating.
The number of constraints determines the number of areas.
sourcepub fn direction(self, direction: Direction) -> Self
pub fn direction(self, direction: Direction) -> Self
Layout direction of the widgets. Direction::Horizontal means the widgets are laid out left to right, with a vertical split area in between.
sourcepub fn split_type(self, split_type: SplitType) -> Self
pub fn split_type(self, split_type: SplitType) -> Self
Controls rendering of the splitter.
sourcepub fn join(self, border: BorderType) -> Self
pub fn join(self, border: BorderType) -> Self
Draw a join character between the split and the border on the left/top side. This sets the border type used for the left/top border.
sourcepub fn join_0(self, border: BorderType) -> Self
pub fn join_0(self, border: BorderType) -> Self
Draw a join character between the split and the border on the left/top side. This sets the border type used for the left/top border.
sourcepub fn join_1(self, border: BorderType) -> Self
pub fn join_1(self, border: BorderType) -> Self
Draw a join character between the split and the border on the right/bottom side. This sets the border type used for the right/bottom border.
sourcepub fn styles(self, styles: SplitStyle) -> Self
pub fn styles(self, styles: SplitStyle) -> Self
Set all styles.
sourcepub fn arrow_style(self, style: Style) -> Self
pub fn arrow_style(self, style: Style) -> Self
Style for the arrows.
sourcepub fn drag_style(self, style: Style) -> Self
pub fn drag_style(self, style: Style) -> Self
Style while dragging the splitter.
sourcepub fn mark_offset(self, offset: u16) -> Self
pub fn mark_offset(self, offset: u16) -> Self
Offset for the split marker from the top/left.
sourcepub fn into_widgets(self) -> (SplitWidget<'a>, SplitOverlay<'a>)
pub fn into_widgets(self) -> (SplitWidget<'a>, SplitOverlay<'a>)
Constructs the widgets for rendering.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Split<'a>
impl<'a> RefUnwindSafe for Split<'a>
impl<'a> Send for Split<'a>
impl<'a> Sync for Split<'a>
impl<'a> Unpin for Split<'a>
impl<'a> UnwindSafe for Split<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more