pub struct ClipperLayout { /* private fields */ }Expand description
ClipperLayout holds all areas for the widgets that want to be displayed.
It uses its own layout coordinates. The scroll offset is in layout coordinates too.
Implementations§
Source§impl ClipperLayout
impl ClipperLayout
Sourcepub fn with_layout(layout: StructuredLayout) -> Self
pub fn with_layout(layout: StructuredLayout) -> Self
New layout from StructuredLayout
Sourcepub fn width_changed(&self, width: u16) -> bool
pub fn width_changed(&self, width: u16) -> bool
Has the target width of the layout changed.
This is helpful if you only want vertical scrolling, and build your layout to fit.
Sourcepub fn add(&mut self, area: &[Rect]) -> AreaHandle
pub fn add(&mut self, area: &[Rect]) -> AreaHandle
Add a layout area.
Sourcepub fn layout_handle(&self, handle: AreaHandle) -> Box<[Rect]>
pub fn layout_handle(&self, handle: AreaHandle) -> Box<[Rect]>
Get the layout area for the given handle
Sourcepub fn layout(&mut self, page: Rect) -> Rect
pub fn layout(&mut self, page: Rect) -> Rect
Run the layout algorithm.
Returns the extended area to render all visible widgets. The size of this area is the required size of the buffer.
- page: in layout coordinates
- ->: extended area in layout coordinates.
Sourcepub fn ext_page_area(&self) -> Rect
pub fn ext_page_area(&self) -> Rect
Extended page area in layout coordinates. This area is at least as large as page_area() and has enough space for partially visible widgets.
Sourcepub fn max_layout_pos(&self) -> (u16, u16)
pub fn max_layout_pos(&self) -> (u16, u16)
Returns the bottom-right corner for the Layout.
Sourcepub fn first_layout_area(&self) -> Option<Box<[Rect]>>
pub fn first_layout_area(&self) -> Option<Box<[Rect]>>
First visible area in buffer in layout coordinates.
Caution Order is the order of addition, not necessarily the top-left area.
Sourcepub fn first_layout_handle(&self) -> Option<AreaHandle>
pub fn first_layout_handle(&self) -> Option<AreaHandle>
First visible area-handle.
Caution Order is the order of addition, not necessarily the top-left area.
Sourcepub fn buf_handle(&self, handle: AreaHandle) -> Box<[Rect]>
pub fn buf_handle(&self, handle: AreaHandle) -> Box<[Rect]>
Converts the areas behind the handle to buffer coordinates. This will return coordinates relative to the extended page. Or None.
Trait Implementations§
Source§impl Clone for ClipperLayout
impl Clone for ClipperLayout
Source§fn clone(&self) -> ClipperLayout
fn clone(&self) -> ClipperLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClipperLayout
impl Debug for ClipperLayout
Source§impl Default for ClipperLayout
impl Default for ClipperLayout
Source§fn default() -> ClipperLayout
fn default() -> ClipperLayout
Auto Trait Implementations§
impl Freeze for ClipperLayout
impl !RefUnwindSafe for ClipperLayout
impl !Send for ClipperLayout
impl !Sync for ClipperLayout
impl Unpin for ClipperLayout
impl !UnwindSafe for ClipperLayout
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