pub struct PageLayout { /* private fields */ }Expand description
PageLayout is fed with the areas that should be displayed.
The areas must use widget relative coordinates not screen coordinates.
It then splits the list in pages in a way that there are no broken areas.
Implementations§
source§impl PageLayout
impl PageLayout
pub fn new() -> Self
sourcepub fn add(&mut self, area: Rect) -> AreaHandle
pub fn add(&mut self, area: Rect) -> AreaHandle
Add a rect.
sourcepub fn add_all(&mut self, areas: impl IntoIterator<Item = Rect>)
pub fn add_all(&mut self, areas: impl IntoIterator<Item = Rect>)
Add rects.
sourcepub fn extend(
&mut self,
areas: impl IntoIterator<Item = Rect>,
handles: &mut Vec<AreaHandle>,
)
pub fn extend( &mut self, areas: impl IntoIterator<Item = Rect>, handles: &mut Vec<AreaHandle>, )
Add rects. Appends the resulting handles.
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 locate_handle(&self, handle: AreaHandle) -> (usize, Rect)
pub fn locate_handle(&self, handle: AreaHandle) -> (usize, 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.
sourcepub fn locate(&self, area: Rect) -> (usize, Rect)
pub fn locate(&self, area: Rect) -> (usize, Rect)
Locate an area.
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.
sourcepub fn first_area(&self, page: usize) -> Option<Rect>
pub fn first_area(&self, page: usize) -> Option<Rect>
First area on the given page.
sourcepub fn first_handle(&self, page: usize) -> Option<AreaHandle>
pub fn first_handle(&self, page: usize) -> Option<AreaHandle>
First area-handle on the given page.
Trait Implementations§
source§impl Clone for PageLayout
impl Clone for PageLayout
source§fn clone(&self) -> PageLayout
fn clone(&self) -> PageLayout
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 PageLayout
impl Debug for PageLayout
source§impl Default for PageLayout
impl Default for PageLayout
source§fn default() -> PageLayout
fn default() -> PageLayout
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PageLayout
impl !RefUnwindSafe for PageLayout
impl !Send for PageLayout
impl !Sync for PageLayout
impl Unpin for PageLayout
impl !UnwindSafe for PageLayout
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