pub struct ScrollView { /* private fields */ }Expand description
A box that shows part of its child, which may be taller, and scrolls it with the mouse wheel or touchpad. Children are cut to the box. Give it a height through its style, or let its parent size it.
use crabshell_ui::{Column, ScrollView, Style, Text};
let log = ScrollView::new(Column::new().child(Text::new("first line")))
.style(Style::new().height(200.0));Implementations§
Source§impl ScrollView
impl ScrollView
Sourcepub fn new(child: impl Widget) -> ScrollView
pub fn new(child: impl Widget) -> ScrollView
A scroll view of child.
Sourcepub fn offset(self, offset: Signal<f32>) -> ScrollView
pub fn offset(self, offset: Signal<f32>) -> ScrollView
Shares the offset: how many logical pixels of the child are scrolled out of view above. Scrolling writes it, and setting it scrolls. Values past either end show that end.
Sourcepub fn style(self, style: impl IntoProp<Style>) -> ScrollView
pub fn style(self, style: impl IntoProp<Style>) -> ScrollView
Sets the style. A scroll view cuts its child to the inside of its
border whatever clip says.
Trait Implementations§
Source§impl Widget for ScrollView
impl Widget for ScrollView
Source§fn into_element(self: Box<Self>) -> Element
fn into_element(self: Box<Self>) -> Element
Turns the description, and everything inside it, into the element
the window builds nodes from. It runs when the window is created or a
list item first appears, before the window’s tree is touched and
without recording what it reads, so it only describes.
Auto Trait Implementations§
impl !RefUnwindSafe for ScrollView
impl !Send for ScrollView
impl !Sync for ScrollView
impl !UnwindSafe for ScrollView
impl Forget for ScrollView
impl Freeze for ScrollView
impl Move for ScrollView
impl Unpin for ScrollView
impl UnsafeUnpin 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