Struct ScrollView
pub struct ScrollView {
pub scroll_x: f32,
pub scroll_y: f32,
pub on_scroll: Option<Arc<dyn Fn(&mut EventContext<'_>, f32, f32) + Sync + Send>>,
pub inner_width: f32,
pub inner_height: f32,
pub container_width: f32,
pub container_height: f32,
pub scroll_to_cursor: bool,
}
Fields§
§scroll_x: f32
Progress of scroll position between 0 and 1 for the x axis
scroll_y: f32
Progress of scroll position between 0 and 1 for the y axis
on_scroll: Option<Arc<dyn Fn(&mut EventContext<'_>, f32, f32) + Sync + Send>>
Callback called when the scrollview is scrolled.
inner_width: f32
Width of the inner VStack which holds the content (typically bigger than container_width)
inner_height: f32
Height of the inner VStack which holds the content (typically bigger than container_height)
container_width: f32
Width of the outer ScrollView
which wraps the inner (typically smaller than inner_width)
container_height: f32
Height of the outer ScrollView
which wraps the inner (typically smaller than inner_height)
scroll_to_cursor: bool
Implementations§
Trait Implementations§
§impl Clone for ScrollView
impl Clone for ScrollView
§fn clone(&self) -> ScrollView
fn clone(&self) -> ScrollView
Returns a copy 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 more§impl Data for ScrollView
impl Data for ScrollView
fn same(&self, other: &ScrollView) -> bool
§impl View for ScrollView
impl View for ScrollView
§fn element(&self) -> Option<&'static str>
fn element(&self) -> Option<&'static str>
Specifies a name for the view type which can be used as an element selector in css. Read more
§fn event(&mut self, cx: &mut EventContext<'_>, event: &mut Event)
fn event(&mut self, cx: &mut EventContext<'_>, event: &mut Event)
Handles any events received by the view. Read more
§fn build<F>(self, cx: &mut Context, content: F) -> Handle<'_, Self>
fn build<F>(self, cx: &mut Context, content: F) -> Handle<'_, Self>
Builds the view into the tree and returns a handle which can be used to apply style and layout modifiers to the view. Read more
§fn draw(&self, cx: &mut DrawContext<'_>, canvas: &Canvas)
fn draw(&self, cx: &mut DrawContext<'_>, canvas: &Canvas)
Provides custom drawing for the view. Read more
fn accessibility(&self, cx: &mut AccessContext<'_>, node: &mut AccessNode)
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.