pub struct DualPagerBuffer<'a> { /* private fields */ }Expand description
Renders directly to the frame buffer.
- It maps your widget area from layout coordinates to screen coordinates before rendering.
- It helps with cleanup of the widget state if your widget is currently invisible.
Implementations§
Source§impl<'a> DualPagerBuffer<'a>
impl<'a> DualPagerBuffer<'a>
Sourcepub fn render_widget<W>(&mut self, widget: W, area: Rect)where
W: Widget,
pub fn render_widget<W>(&mut self, widget: W, area: Rect)where
W: Widget,
Render a widget to the buffer.
Sourcepub fn render_stateful<W, S>(&mut self, widget: W, area: Rect, state: &mut S)where
W: StatefulWidget<State = S>,
S: RelocatableState,
pub fn render_stateful<W, S>(&mut self, widget: W, area: Rect, state: &mut S)where
W: StatefulWidget<State = S>,
S: RelocatableState,
Render a widget to the buffer. This expects that the state is a RelocatableState, so it can reset the areas for hidden widgets.
Sourcepub fn render_widget_handle<W, Idx>(
&mut self,
widget: W,
area: AreaHandle,
tag: Idx,
)
pub fn render_widget_handle<W, Idx>( &mut self, widget: W, area: AreaHandle, tag: Idx, )
Render a widget to the buffer.
Sourcepub fn render_stateful_handle<W, S, Idx>(
&mut self,
widget: W,
area: AreaHandle,
tag: Idx,
state: &mut S,
)
pub fn render_stateful_handle<W, S, Idx>( &mut self, widget: W, area: AreaHandle, tag: Idx, state: &mut S, )
Render a widget to the buffer.
This expects that the state is a RelocatableState, so it can reset the areas for hidden widgets.
Sourcepub fn layout(&self) -> &PagerLayout
pub fn layout(&self) -> &PagerLayout
Return the layout.
Sourcepub fn is_visible_area(&self, area: Rect) -> bool
pub fn is_visible_area(&self, area: Rect) -> bool
Is the given area visible?
Sourcepub fn is_visible_handle(&self, handle: AreaHandle) -> bool
pub fn is_visible_handle(&self, handle: AreaHandle) -> bool
Is the given area visible?
Sourcepub fn shift(&self) -> (i16, i16)
pub fn shift(&self) -> (i16, i16)
Calculate the necessary shift from view to screen. This does nothing as pager always places the widgets in screen coordinates.
Just to keep the api in sync with [Clipper].
Sourcepub fn locate_handle(&self, handle: AreaHandle) -> Option<Box<[Rect]>>
pub fn locate_handle(&self, handle: AreaHandle) -> Option<Box<[Rect]>>
Relocate an area from layout coordinates to screen coordinates. A result None indicates that the area is invisible.
Sourcepub fn locate_area(&self, layout_area: Rect) -> Option<Rect>
pub fn locate_area(&self, layout_area: Rect) -> Option<Rect>
Relocate an area from layout coordinates to screen coordinates. A result None indicates that the area is invisible.
Sourcepub fn relocate<S>(&self, _state: &mut S)where
S: RelocatableState,
pub fn relocate<S>(&self, _state: &mut S)where
S: RelocatableState,
Does nothing for pager. Just to keep the api in sync with [Clipper].
Clear the areas in the widget-state. This is called by render_xx whenever a widget is invisible.
Sourcepub fn buffer_mut(&mut self) -> &mut Buffer
pub fn buffer_mut(&mut self) -> &mut Buffer
Access the buffer. Note Use of render_xxx is preferred.
Sourcepub fn into_widget(self) -> DualPagerWidget
pub fn into_widget(self) -> DualPagerWidget
Rendering the content is finished.
Convert to the final widget to render the finishings.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DualPagerBuffer<'a>
impl<'a> !RefUnwindSafe for DualPagerBuffer<'a>
impl<'a> !Send for DualPagerBuffer<'a>
impl<'a> !Sync for DualPagerBuffer<'a>
impl<'a> Unpin for DualPagerBuffer<'a>
impl<'a> !UnwindSafe for DualPagerBuffer<'a>
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