pub struct ScrollView { /* private fields */ }Expand description
A scrollable view widget
Implementations§
Source§impl ScrollView
impl ScrollView
Sourcepub fn content_height(self, height: u16) -> Self
pub fn content_height(self, height: u16) -> Self
Set the total content height
Sourcepub fn scroll_offset(self, offset: u16) -> Self
pub fn scroll_offset(self, offset: u16) -> Self
Set the scroll offset
Sourcepub fn show_scrollbar(self, show: bool) -> Self
pub fn show_scrollbar(self, show: bool) -> Self
Enable/disable scrollbar
Sourcepub fn scrollbar_style(self, fg: Color, bg: Color) -> Self
pub fn scrollbar_style(self, fg: Color, bg: Color) -> Self
Set scrollbar colors
Sourcepub fn set_offset(&mut self, offset: u16, viewport_height: u16)
pub fn set_offset(&mut self, offset: u16, viewport_height: u16)
Set scroll offset with bounds checking
Sourcepub fn scroll_down(&mut self, lines: u16, viewport_height: u16)
pub fn scroll_down(&mut self, lines: u16, viewport_height: u16)
Scroll down by lines
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to top
Sourcepub fn scroll_to_bottom(&mut self, viewport_height: u16)
pub fn scroll_to_bottom(&mut self, viewport_height: u16)
Scroll to bottom
Sourcepub fn handle_key(&mut self, key: &Key, viewport_height: u16) -> bool
pub fn handle_key(&mut self, key: &Key, viewport_height: u16) -> bool
Handle key input, returns true if scroll changed
Sourcepub fn is_scrollable(&self, viewport_height: u16) -> bool
pub fn is_scrollable(&self, viewport_height: u16) -> bool
Check if content is scrollable
Sourcepub fn scroll_percentage(&self, viewport_height: u16) -> f32
pub fn scroll_percentage(&self, viewport_height: u16) -> f32
Get scroll percentage (0.0 - 1.0)
Sourcepub fn render_scrollbar(&self, ctx: &mut RenderContext<'_>)
pub fn render_scrollbar(&self, ctx: &mut RenderContext<'_>)
Render scrollbar
Sourcepub fn content_area(&self, area: Rect) -> Rect
pub fn content_area(&self, area: Rect) -> Rect
Get the visible area for content (excludes scrollbar)
Sourcepub fn create_content_buffer(&self, width: u16) -> Buffer
pub fn create_content_buffer(&self, width: u16) -> Buffer
Create a clipped buffer for scrolled content
Sourcepub fn render_content(
&self,
ctx: &mut RenderContext<'_>,
content_buffer: &Buffer,
)
pub fn render_content( &self, ctx: &mut RenderContext<'_>, content_buffer: &Buffer, )
Render scrolled content from a pre-rendered buffer
Source§impl ScrollView
impl ScrollView
Trait Implementations§
Source§impl Default for ScrollView
impl Default for ScrollView
Source§impl StyledView for ScrollView
impl StyledView for ScrollView
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Remove a CSS class
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Toggle a CSS class
Source§impl View for ScrollView
impl View for ScrollView
Source§fn meta(&self) -> WidgetMeta
fn meta(&self) -> WidgetMeta
Get widget metadata for DOM
Source§fn render(&self, ctx: &mut RenderContext<'_>)
fn render(&self, ctx: &mut RenderContext<'_>)
Render the view
Source§fn widget_type(&self) -> &'static str
fn widget_type(&self) -> &'static str
Get widget type name (for CSS type selectors)
Auto Trait Implementations§
impl Freeze for ScrollView
impl RefUnwindSafe for ScrollView
impl Send for ScrollView
impl Sync for ScrollView
impl Unpin for ScrollView
impl UnwindSafe for ScrollView
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().