Struct rat_widget::scrolled::Scrolled
source · pub struct Scrolled<'a, T> { /* private fields */ }Expand description
A wrapper widget that scrolls it’s content.
Implementations§
source§impl<'a, T> Scrolled<'a, T>
impl<'a, T> Scrolled<'a, T>
sourcepub fn vertical_overscroll(self, n: usize) -> Scrolled<'a, T>
pub fn vertical_overscroll(self, n: usize) -> Scrolled<'a, T>
Allow overscrolling the max_offset by n.
sourcepub fn horizontal_overscroll(self, n: usize) -> Scrolled<'a, T>
pub fn horizontal_overscroll(self, n: usize) -> Scrolled<'a, T>
Allow overscrolling the max_offset by n.
sourcepub fn horizontal_scrollbar_policy(
self,
policy: ScrollbarPolicy,
) -> Scrolled<'a, T>
pub fn horizontal_scrollbar_policy( self, policy: ScrollbarPolicy, ) -> Scrolled<'a, T>
Horizontal scrollbar policy.
sourcepub fn vertical_scrollbar_policy(
self,
policy: ScrollbarPolicy,
) -> Scrolled<'a, T>
pub fn vertical_scrollbar_policy( self, policy: ScrollbarPolicy, ) -> Scrolled<'a, T>
Vertical scrollbar policy.
sourcepub fn horizontal_scroll_position(self, pos: HScrollPosition) -> Scrolled<'a, T>
pub fn horizontal_scroll_position(self, pos: HScrollPosition) -> Scrolled<'a, T>
Position
sourcepub fn vertical_scroll_position(self, pos: VScrollPosition) -> Scrolled<'a, T>
pub fn vertical_scroll_position(self, pos: VScrollPosition) -> Scrolled<'a, T>
Position
sourcepub fn block(self, block: Block<'a>) -> Scrolled<'a, T>
pub fn block(self, block: Block<'a>) -> Scrolled<'a, T>
Block around the scrolled widget. The scrollbars are drawn as part of the block.
Attention: There must be a border at the sides where you want the scrollbars. Otherwise, the calculations for the scrollbar placement will be off somewhat.
pub fn styles(self, styles: ScrolledStyle) -> Scrolled<'a, T>
sourcepub fn thumb_symbol(self, thumb_symbol: &'a str) -> Scrolled<'a, T>
pub fn thumb_symbol(self, thumb_symbol: &'a str) -> Scrolled<'a, T>
Symbol for the Scrollbar.
sourcepub fn thumb_style<S>(self, thumb_style: S) -> Scrolled<'a, T>
pub fn thumb_style<S>(self, thumb_style: S) -> Scrolled<'a, T>
Style for the Scrollbar.
sourcepub fn track_symbol(self, track_symbol: Option<&'a str>) -> Scrolled<'a, T>
pub fn track_symbol(self, track_symbol: Option<&'a str>) -> Scrolled<'a, T>
Symbol for the Scrollbar.
sourcepub fn track_style<S>(self, track_style: S) -> Scrolled<'a, T>
pub fn track_style<S>(self, track_style: S) -> Scrolled<'a, T>
Style for the Scrollbar.
sourcepub fn begin_symbol(self, begin_symbol: Option<&'a str>) -> Scrolled<'a, T>
pub fn begin_symbol(self, begin_symbol: Option<&'a str>) -> Scrolled<'a, T>
Symbol for the Scrollbar.
sourcepub fn begin_style<S>(self, begin_style: S) -> Scrolled<'a, T>
pub fn begin_style<S>(self, begin_style: S) -> Scrolled<'a, T>
Style for the Scrollbar.
sourcepub fn end_symbol(self, end_symbol: Option<&'a str>) -> Scrolled<'a, T>
pub fn end_symbol(self, end_symbol: Option<&'a str>) -> Scrolled<'a, T>
Symbol for the Scrollbar.
source§impl<'a, W> Scrolled<'a, View<W>>where
W: Widget,
impl<'a, W> Scrolled<'a, View<W>>where
W: Widget,
source§impl<'a, W> Scrolled<'a, Viewport<W>>where
W: StatefulWidget,
impl<'a, W> Scrolled<'a, Viewport<W>>where
W: StatefulWidget,
sourcepub fn new_viewport(inner: W) -> Scrolled<'a, Viewport<W>>
pub fn new_viewport(inner: W) -> Scrolled<'a, Viewport<W>>
sourcepub fn view_style(self, style: Style) -> Scrolled<'a, Viewport<W>>
pub fn view_style(self, style: Style) -> Scrolled<'a, Viewport<W>>
Style for the empty space outside the rendered buffer.
Trait Implementations§
source§impl<'a, W> StatefulWidget for Scrolled<'a, W>where
W: StatefulWidget + ScrollingWidget<<W as StatefulWidget>::State>,
<W as StatefulWidget>::State: ScrollingState,
impl<'a, W> StatefulWidget for Scrolled<'a, W>where
W: StatefulWidget + ScrollingWidget<<W as StatefulWidget>::State>,
<W as StatefulWidget>::State: ScrollingState,
§type State = ScrolledState<<W as StatefulWidget>::State>
type State = ScrolledState<<W as StatefulWidget>::State>
State associated with the stateful widget. Read more
source§impl<'a, W> StatefulWidgetRef for Scrolled<'a, W>where
W: StatefulWidgetRef + ScrollingWidget<<W as StatefulWidgetRef>::State>,
<W as StatefulWidgetRef>::State: ScrollingState,
impl<'a, W> StatefulWidgetRef for Scrolled<'a, W>where
W: StatefulWidgetRef + ScrollingWidget<<W as StatefulWidgetRef>::State>,
<W as StatefulWidgetRef>::State: ScrollingState,
§type State = ScrolledState<<W as StatefulWidgetRef>::State>
type State = ScrolledState<<W as StatefulWidgetRef>::State>
State associated with the stateful widget. Read more
source§fn render_ref(
&self,
area: Rect,
buf: &mut Buffer,
state: &mut <Scrolled<'a, W> as StatefulWidgetRef>::State,
)
fn render_ref( &self, area: Rect, buf: &mut Buffer, state: &mut <Scrolled<'a, W> as StatefulWidgetRef>::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, T> Freeze for Scrolled<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Scrolled<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Scrolled<'a, T>where
T: Send,
impl<'a, T> Sync for Scrolled<'a, T>where
T: Sync,
impl<'a, T> Unpin for Scrolled<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Scrolled<'a, T>where
T: UnwindSafe,
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> 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