pub struct SplitPane { /* private fields */ }Expand description
Resizable split pane dividing a region into two parts.
Implementations§
Source§impl SplitPane
impl SplitPane
Sourcepub fn new(orientation: Orientation, ratio: f32, min_ratio: f32) -> Self
pub fn new(orientation: Orientation, ratio: f32, min_ratio: f32) -> Self
Create a new split pane with the given orientation, ratio, and minimum ratio.
Sourcepub fn horizontal() -> Self
pub fn horizontal() -> Self
Create a horizontal split at 50%.
Sourcepub fn resize(&mut self, ratio: f32)
pub fn resize(&mut self, ratio: f32)
Resize the split, clamping to [min_ratio, 1.0 - min_ratio].
Sourcepub fn orientation(&self) -> Orientation
pub fn orientation(&self) -> Orientation
Returns the orientation.
Sourcepub fn first_rect(&self, bounds: &Rect) -> Rect
pub fn first_rect(&self, bounds: &Rect) -> Rect
Calculate the first pane’s rectangle within the given bounds.
Sourcepub fn second_rect(&self, bounds: &Rect) -> Rect
pub fn second_rect(&self, bounds: &Rect) -> Rect
Calculate the second pane’s rectangle within the given bounds.
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 UnsafeUnpin 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