pub struct ScrollArea<'a> { /* private fields */ }Expand description
Utility widget for rendering a combination of a Block and one or two Scroll(bars). Any of these can be None.
Implementations§
Source§impl<'a> ScrollArea<'a>
impl<'a> ScrollArea<'a>
pub fn new() -> ScrollArea<'a>
Sourcepub fn style(self, style: Style) -> ScrollArea<'a>
pub fn style(self, style: Style) -> ScrollArea<'a>
Set the base style.
Sourcepub fn block(self, block: Option<&'a Block<'a>>) -> ScrollArea<'a>
pub fn block(self, block: Option<&'a Block<'a>>) -> ScrollArea<'a>
Sets the block.
Sourcepub fn h_scroll(self, scroll: Option<&'a Scroll<'a>>) -> ScrollArea<'a>
pub fn h_scroll(self, scroll: Option<&'a Scroll<'a>>) -> ScrollArea<'a>
Sets the horizontal scroll.
Sourcepub fn v_scroll(self, scroll: Option<&'a Scroll<'a>>) -> ScrollArea<'a>
pub fn v_scroll(self, scroll: Option<&'a Scroll<'a>>) -> ScrollArea<'a>
Sets the vertical scroll.
Sourcepub fn inner(
&self,
area: Rect,
hscroll_state: Option<&ScrollState>,
vscroll_state: Option<&ScrollState>,
) -> Rect
pub fn inner( &self, area: Rect, hscroll_state: Option<&ScrollState>, vscroll_state: Option<&ScrollState>, ) -> Rect
Calculate the size of the inner area.
Source§impl<'a> ScrollArea<'a>
impl<'a> ScrollArea<'a>
Sourcepub fn render_block(&self, area: Rect, buf: &mut Buffer)
pub fn render_block(&self, area: Rect, buf: &mut Buffer)
Only render the Block.
Sourcepub fn render_scrollbars(
&self,
area: Rect,
buf: &mut Buffer,
state: &mut ScrollAreaState<'_>,
)
pub fn render_scrollbars( &self, area: Rect, buf: &mut Buffer, state: &mut ScrollAreaState<'_>, )
Only render the scrollbars.
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 duplicate 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.
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§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