pub struct PagerLayout { /* private fields */ }Expand description
PagerLayout holds all areas for the widgets that want to be displayed.
It uses its own layout coordinates.
The layout step breaks this list into pages that can fit the widgets. If your widget is too big to fit in the page area it will be placed at a new page and will be clipped into shape.
Implementations§
Source§impl PagerLayout
impl PagerLayout
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.
Sourcepub fn add(&mut self, area: &[Rect]) -> AreaHandle
pub fn add(&mut self, area: &[Rect]) -> AreaHandle
Add a rect.
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 break_after(&mut self, y: u16)
pub fn break_after(&mut self, y: u16)
Add a manual break after the given position.
Sourcepub fn break_before(&mut self, y: u16)
pub fn break_before(&mut self, y: u16)
Add a manual break before the given position.
Sourcepub fn first_layout_area(&self, page: usize) -> Option<Box<[Rect]>>
pub fn first_layout_area(&self, page: usize) -> Option<Box<[Rect]>>
First area on the given page.
Sourcepub fn first_layout_handle(&self, page: usize) -> Option<AreaHandle>
pub fn first_layout_handle(&self, page: usize) -> Option<AreaHandle>
First area-handle on the given page.
Sourcepub fn buf_handle(&self, handle: AreaHandle) -> (usize, Box<[Rect]>)
pub fn buf_handle(&self, handle: AreaHandle) -> (usize, Box<[Rect]>)
Locate an area by handle.
This will return a Rect with a y-value relative to the page it is in. But still in layout-coords.
And it returns the page the Rect is on.
Trait Implementations§
Source§impl Clone for PagerLayout
impl Clone for PagerLayout
Source§fn clone(&self) -> PagerLayout
fn clone(&self) -> PagerLayout
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PagerLayout
impl Debug for PagerLayout
Source§impl Default for PagerLayout
impl Default for PagerLayout
Source§fn default() -> PagerLayout
fn default() -> PagerLayout
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PagerLayout
impl !RefUnwindSafe for PagerLayout
impl !Send for PagerLayout
impl !Sync for PagerLayout
impl Unpin for PagerLayout
impl !UnwindSafe for PagerLayout
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> 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)
🔬This is a nightly-only experimental API. (
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>
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