pub struct Splitter<'a, Msg> { /* private fields */ }Expand description
Two panes that share an area: side by side with Splitter::columns, stacked with
Splitter::rows. The application owns the size of the first pane; the second takes the
rest.
Without Splitter::on_resize the panes simply sit next to each other. With it, a one-cell
boundary separates them. The boundary is invisible until the pointer reaches it: then it
brightens one step, and while dragged it takes the accent. It can also be focused with Tab
and moved with the arrow keys (Shift moves five cells, Home and End jump to the limits).
Style keys: split-handle (bg, fg) with hover, focus and active (dragging).
Implementations§
Source§impl<'a, Msg: 'static> Splitter<'a, Msg>
impl<'a, Msg: 'static> Splitter<'a, Msg>
Sourcepub fn columns(width: u16) -> Self
pub fn columns(width: u16) -> Self
Panes side by side; the first (left) pane is width columns wide.
Sourcepub fn limits(self, min: u16, max: impl Into<Option<u16>>) -> Self
pub fn limits(self, min: u16, max: impl Into<Option<u16>>) -> Self
The smallest and largest size of the first pane, in cells: limits(16, 60) for a range, or
limits(16, None) for no upper limit. By default 1 and no upper limit; whatever the limits,
the second pane keeps at least one cell. A max below min counts as min.
Sourcepub fn on_resize(self, message: impl Fn(u16) -> Msg + 'static) -> Self
pub fn on_resize(self, message: impl Fn(u16) -> Msg + 'static) -> Self
Makes the boundary draggable and focusable; the message carries the first pane’s new size, already within the limits.
Auto Trait Implementations§
impl<'a, Msg> !RefUnwindSafe for Splitter<'a, Msg>
impl<'a, Msg> !Send for Splitter<'a, Msg>
impl<'a, Msg> !Sync for Splitter<'a, Msg>
impl<'a, Msg> !UnwindSafe for Splitter<'a, Msg>
impl<'a, Msg> Freeze for Splitter<'a, Msg>
impl<'a, Msg> Unpin for Splitter<'a, Msg>
impl<'a, Msg> UnsafeUnpin for Splitter<'a, Msg>where
Option<Box<dyn Fn(u16) -> Msg>>: UnsafeUnpin,
Option<Box<dyn FnOnce(&mut View<'_, Msg>) + 'a>>: UnsafeUnpin,
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> 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