pub struct SplitPane<'a> { /* private fields */ }Expand description
A resizable split pane component
Implementations§
Source§impl<'a> SplitPane<'a>
impl<'a> SplitPane<'a>
Sourcepub fn new(state: &'a SplitPaneState) -> Self
pub fn new(state: &'a SplitPaneState) -> Self
Create a new SplitPane with the given state
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) -> (Rect, Rect, Rect)
pub fn calculate_areas(&self, area: Rect) -> (Rect, Rect, Rect)
Calculate the layout areas for the split pane
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) -> ClickRegion<SplitPaneAction>
pub fn divider_click_region(&self, area: Rect) -> ClickRegion<SplitPaneAction>
Get a simple click region for the divider
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SplitPane<'a>
impl<'a> RefUnwindSafe for SplitPane<'a>
impl<'a> Send for SplitPane<'a>
impl<'a> Sync for SplitPane<'a>
impl<'a> Unpin for SplitPane<'a>
impl<'a> UnwindSafe for SplitPane<'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
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