pub struct CustomScrollbar<'a> { /* private fields */ }Expand description
Custom scrollbar widget for markdown navigation.
Shows scroll position using block characters with accurate tracking. Supports click-to-scroll and drag interactions.
This is a UI-only widget that receives &ScrollState for state access.
State mutations happen through ScrollState methods, not here.
§Example
ⓘ
use ratatui_toolkit::markdown_widget::state::scroll::ScrollState;
let scroll_state = ScrollState::default();
let scrollbar = CustomScrollbar::new(&scroll_state)
.config(ScrollbarConfig::default())
.show_percentage(true);Implementations§
Source§impl<'a> CustomScrollbar<'a>
Constructor methods for CustomScrollbar.
impl<'a> CustomScrollbar<'a>
Constructor methods for CustomScrollbar.
Sourcepub fn new(scroll_state: &'a ScrollState) -> CustomScrollbar<'a>
Available on crate feature markdown-preview only.
pub fn new(scroll_state: &'a ScrollState) -> CustomScrollbar<'a>
markdown-preview only.Sourcepub fn config(self, config: ScrollbarConfig) -> CustomScrollbar<'a>
Available on crate feature markdown-preview only.
pub fn config(self, config: ScrollbarConfig) -> CustomScrollbar<'a>
markdown-preview only.Sourcepub fn show_percentage(self, show: bool) -> CustomScrollbar<'a>
Available on crate feature markdown-preview only.
pub fn show_percentage(self, show: bool) -> CustomScrollbar<'a>
markdown-preview only.impl<'a> CustomScrollbar<'a>
This impl block contains no items.
Render the scrollbar thumb (scrollable indicator).
impl<'a> CustomScrollbar<'a>
This impl block contains no items.
Render the scrollbar track (background).
Trait Implementations§
Source§impl<'a> Debug for CustomScrollbar<'a>
impl<'a> Debug for CustomScrollbar<'a>
Auto Trait Implementations§
impl<'a> Freeze for CustomScrollbar<'a>
impl<'a> RefUnwindSafe for CustomScrollbar<'a>
impl<'a> Send for CustomScrollbar<'a>
impl<'a> Sync for CustomScrollbar<'a>
impl<'a> Unpin for CustomScrollbar<'a>
impl<'a> UnsafeUnpin for CustomScrollbar<'a>
impl<'a> UnwindSafe for CustomScrollbar<'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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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