pub struct SplitPane { /* private fields */ }Expand description
A resizable split pane component
Implementations§
Source§impl SplitPane
impl SplitPane
Sourcepub fn orientation(self, orientation: Orientation) -> Self
pub fn orientation(self, orientation: Orientation) -> Self
Set the orientation (horizontal or vertical)
Sourcepub fn style(self, style: SplitPaneStyle) -> Self
pub fn style(self, style: SplitPaneStyle) -> Self
Set the style
Sourcepub fn min_percent(self, min_percent: u16) -> Self
pub fn min_percent(self, min_percent: u16) -> Self
Set the minimum percentage for the first pane
Sourcepub fn max_percent(self, max_percent: u16) -> Self
pub fn max_percent(self, max_percent: u16) -> Self
Set the maximum percentage for the first pane
Sourcepub fn divider_char(self, char: &'static str) -> Self
pub fn divider_char(self, char: &'static str) -> Self
Set the divider character
Sourcepub fn calculate_areas(
&self,
area: Rect,
split_percent: u16,
) -> (Rect, Rect, Rect)
pub fn calculate_areas( &self, area: Rect, split_percent: u16, ) -> (Rect, Rect, Rect)
Calculate the layout areas for the split pane
Takes a split_percent (0-100) to determine the first pane size.
Sourcepub fn render_with_content<F1, F2>(
&self,
area: Rect,
buf: &mut Buffer,
state: &mut SplitPaneState,
first_pane_renderer: F1,
second_pane_renderer: F2,
registry: &mut ClickRegionRegistry<SplitPaneAction>,
)
pub fn render_with_content<F1, F2>( &self, area: Rect, buf: &mut Buffer, state: &mut SplitPaneState, first_pane_renderer: F1, second_pane_renderer: F2, registry: &mut ClickRegionRegistry<SplitPaneAction>, )
Render the split pane with custom content renderers and click region registry
Sourcepub fn render_divider_only(
&self,
area: Rect,
buf: &mut Buffer,
state: &mut SplitPaneState,
) -> (Rect, Rect, Rect)
pub fn render_divider_only( &self, area: Rect, buf: &mut Buffer, state: &mut SplitPaneState, ) -> (Rect, Rect, Rect)
Render just the split pane divider (for cases where content is rendered separately)
Sourcepub fn divider_click_region(
&self,
area: Rect,
split_percent: u16,
) -> ClickRegion<SplitPaneAction>
pub fn divider_click_region( &self, area: Rect, split_percent: u16, ) -> ClickRegion<SplitPaneAction>
Get a simple click region for the divider
Sourcepub fn get_orientation(&self) -> Orientation
pub fn get_orientation(&self) -> Orientation
Get the orientation
Sourcepub fn get_min_percent(&self) -> u16
pub fn get_min_percent(&self) -> u16
Get min_percent
Sourcepub fn get_max_percent(&self) -> u16
pub fn get_max_percent(&self) -> u16
Get max_percent
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SplitPane
impl RefUnwindSafe for SplitPane
impl Send for SplitPane
impl Sync for SplitPane
impl Unpin for SplitPane
impl UnwindSafe for SplitPane
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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