Struct rat_widget::scrolled::ScrollArea
source · pub struct ScrollArea<'a> { /* private fields */ }Expand description
Utility widget for layout/rendering the combined block and scrollbars.
It layouts the scrollbars on top of the border and leaves the corners free if necessary.
Implementations§
source§impl<'a> ScrollArea<'a>
impl<'a> ScrollArea<'a>
pub fn new() -> ScrollArea<'a>
sourcepub fn block(self, block: Option<Block<'a>>) -> ScrollArea<'a>
pub fn block(self, block: Option<Block<'a>>) -> ScrollArea<'a>
Sets the block.
sourcepub fn h_scroll(self, scroll: Option<Scroll<'a>>) -> ScrollArea<'a>
pub fn h_scroll(self, scroll: Option<Scroll<'a>>) -> ScrollArea<'a>
Sets the horizontal scroll.
sourcepub fn v_scroll(self, scroll: Option<Scroll<'a>>) -> ScrollArea<'a>
pub fn v_scroll(self, scroll: Option<Scroll<'a>>) -> ScrollArea<'a>
Sets the vertical scroll.
source§impl<'a> ScrollArea<'a>
impl<'a> ScrollArea<'a>
sourcepub fn inner(&self, area: Rect, state: ScrollAreaState<'_>) -> Rect
pub fn inner(&self, area: Rect, state: ScrollAreaState<'_>) -> Rect
Calculates the inner area for the widget.
Panic Panics if the orientation doesn’t match, h_scroll doesn’t accept ScrollBarOrientation::Vertical* and v_scroll doesn’t accept ScrollBarOrientation::Horizontal*.
Panics if the state doesn’t contain the necessary scroll-states.
Trait Implementations§
source§impl<'a> Clone for ScrollArea<'a>
impl<'a> Clone for ScrollArea<'a>
source§fn clone(&self) -> ScrollArea<'a>
fn clone(&self) -> ScrollArea<'a>
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<'a> Debug for ScrollArea<'a>
impl<'a> Debug for ScrollArea<'a>
source§impl<'a> Default for ScrollArea<'a>
impl<'a> Default for ScrollArea<'a>
source§fn default() -> ScrollArea<'a>
fn default() -> ScrollArea<'a>
Returns the “default value” for a type. Read more
source§impl<'a> StatefulWidget for ScrollArea<'a>
impl<'a> StatefulWidget for ScrollArea<'a>
source§type State = ScrollAreaState<'a>
type State = ScrollAreaState<'a>
State associated with the stateful widget. Read more
source§fn render(
self,
area: Rect,
buf: &mut Buffer,
state: &mut <ScrollArea<'a> as StatefulWidget>::State,
)
fn render( self, area: Rect, buf: &mut Buffer, state: &mut <ScrollArea<'a> as StatefulWidget>::State, )
Draws the current state of the widget in the given buffer. That is the only method required
to implement a custom stateful widget.
Auto Trait Implementations§
impl<'a> Freeze for ScrollArea<'a>
impl<'a> RefUnwindSafe for ScrollArea<'a>
impl<'a> Send for ScrollArea<'a>
impl<'a> Sync for ScrollArea<'a>
impl<'a> Unpin for ScrollArea<'a>
impl<'a> UnwindSafe for ScrollArea<'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
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