Skip to main content

ScrollView

Struct ScrollView 

Source
pub struct ScrollView { /* private fields */ }

Implementations§

Source§

impl ScrollView

Source

pub fn new(child: impl View + 'static) -> Self

Source

pub fn with_child(&self, child: impl View + 'static) -> Self

Source

pub fn axis(self, axis: ScrollAxis) -> Self

Source

pub fn vertical(self) -> Self

Source

pub fn horizontal(self) -> Self

Source

pub fn both(self) -> Self

Source

pub fn scrollbar_visibility(self, visibility: ScrollbarVisibility) -> Self

Source

pub fn show_scrollbar(self, show: bool) -> Self

Source

pub fn scrollbar_width(self, width: f32) -> Self

Source

pub fn scrollbar_track(self, color: Color) -> Self

Source

pub fn scrollbar_thumb(self, color: Color) -> Self

Source

pub fn scroll_step(self, step: f32) -> Self

Source

pub fn on_scroll(self, handler: impl Fn(Vec2) + 'static) -> Self

Source

pub fn scroll_axis(&self) -> ScrollAxis

Source

pub fn offset(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn offset_x(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn offset_y(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn offset_vec(&self, rt: &Runtime, el: ElementId) -> Vec2

Source

pub fn content_height(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn content_width(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn content_size(&self, rt: &Runtime, el: ElementId) -> Size

Source

pub fn viewport_size(&self, rt: &Runtime, el: ElementId) -> Size

Source

pub fn viewport_width(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn viewport_height(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn max_offset(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn max_offset_x(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn max_offset_y(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn max_offset_vec(&self, rt: &Runtime, el: ElementId) -> Vec2

Source

pub fn can_scroll_x(&self, rt: &Runtime, el: ElementId) -> bool

Source

pub fn can_scroll_y(&self, rt: &Runtime, el: ElementId) -> bool

Source

pub fn scroll_fraction(&self, rt: &Runtime, el: ElementId) -> Vec2

Source

pub fn scroll_fraction_x(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn scroll_fraction_y(&self, rt: &Runtime, el: ElementId) -> f32

Source

pub fn scroll_to(&self, rt: &Runtime, el: ElementId, offset: Vec2)

Source

pub fn scroll_to_xy(&self, rt: &Runtime, el: ElementId, x: f32, y: f32)

Source

pub fn scroll_to_x(&self, rt: &Runtime, el: ElementId, x: f32)

Source

pub fn scroll_to_y(&self, rt: &Runtime, el: ElementId, y: f32)

Source

pub fn scroll_by(&self, rt: &Runtime, el: ElementId, delta: Vec2)

Source

pub fn scroll_to_top(&self, rt: &Runtime, el: ElementId)

Source

pub fn scroll_to_bottom(&self, rt: &Runtime, el: ElementId)

Source

pub fn scroll_into_view(&self, rt: &Runtime, el: ElementId, rect: Rect)

Source

pub fn scroll_element_into_view( &self, rt: &Runtime, el: ElementId, child: ElementId, )

Source

pub fn scroll_to_left(&self, rt: &Runtime, el: ElementId)

Source

pub fn scroll_to_right(&self, rt: &Runtime, el: ElementId)

Source

pub fn page_up(&self, rt: &Runtime, el: ElementId)

Source

pub fn page_down(&self, rt: &Runtime, el: ElementId)

Source

pub fn page_left(&self, rt: &Runtime, el: ElementId)

Source

pub fn page_right(&self, rt: &Runtime, el: ElementId)

Source

pub fn ensure_visible(&self, rt: &Runtime, el: ElementId, rect: Rect) -> bool

Trait Implementations§

Source§

impl Clone for ScrollView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl View for ScrollView

Source§

fn body(&self) -> impl View + 'static

Source§

fn arrange_override( &self, rt: &Runtime, el: ElementId, rect: Rect, ctx: &mut LayoutCtx<'_>, ) -> bool

Source§

fn clip_self(&self) -> bool

Source§

fn captures_pointer_ctx(&self, rt: &Runtime, el: ElementId) -> bool

Source§

fn paint_foreground(&self, ctx: &mut PaintCtx<'_>)

Source§

fn layout_style_ctx(&self, _rt: &Runtime, _el: ElementId) -> LayoutStyle

Source§

fn accessibility(&self) -> Option<Accessible>

Source§

fn clip_radius(&self) -> f32

Source§

fn paint_opacity(&self) -> Option<f32>

Source§

fn paint_opacity_ctx(&self, _rt: &Runtime, _el: ElementId) -> Option<f32>

Source§

fn paint_offset(&self) -> Vec2

Source§

fn paint_offset_ctx(&self, _rt: &Runtime, _el: ElementId) -> Vec2

Source§

fn paint_scale(&self) -> f32

Source§

fn paint_scale_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32

Source§

fn paint_rotation(&self) -> f32

Source§

fn paint_rotation_ctx(&self, _rt: &Runtime, _el: ElementId) -> f32

Source§

fn foreground_filter(&self) -> Option<Filter>

Source§

fn reuse_state(&self, _old: &Self)

Source§

fn hit_testable(&self) -> bool

Source§

fn test_id(&self) -> Option<String>

Source§

fn focus_trap(&self) -> bool

Source§

fn accepts_tab(&self) -> bool

Source§

fn accepts_drop(&self, _payload: &DragPayload) -> bool

Source§

fn on_drag_over(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>)

Source§

fn on_drop(&self, _pos: DropPosition, _ctx: &mut EventCtx<'_>)

Source§

fn on_drag_start(&self, _ctx: &mut EventCtx<'_>)

Source§

fn on_drag_end(&self, _end: DragEnd, _ctx: &mut EventCtx<'_>)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> FilterExt for T
where T: View + 'static,

Source§

fn blur_own(self, radius: f32) -> Filtered

Source§

fn blur_own_with(self, build: impl FnOnce(Filter) -> Filter) -> Filtered

Source§

fn blur_behind(self, radius: f32) -> BackdropFiltered

Source§

fn blur_behind_with( self, build: impl FnOnce(Backdrop) -> Backdrop, ) -> BackdropFiltered

Source§

fn effect(self, effect: Effect) -> EffectNode

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LiveExt for T
where T: View + 'static,

Source§

fn opacity_live(self, live: impl Into<Live<f32>>) -> LiveOpacity

Source§

fn offset_live(self, live: impl Into<Live<Vec2>>) -> LiveOffset

Source§

fn background_live(self, live: impl Into<Live<Color>>) -> LiveBackground

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ViewModifiers for T
where T: View + 'static,

Source§

fn opacity(self, opacity: impl Into<Live<f32>>) -> LiveOpacity

Source§

fn offset(self, dx: f32, dy: f32) -> LiveOffset

Source§

fn offset_by(self, offset: impl Into<Live<Vec2>>) -> LiveOffset

Source§

fn background(self, color: impl Into<Live<Color>>) -> LiveBackground

Source§

fn bg(self, color: impl Into<Live<Color>>) -> LiveBackground

Source§

fn blur(self, px: f32) -> Filtered

Source§

fn shadow(self, spec: ShadowSpec) -> EffectNode

Source§

fn clip(self) -> Clip

Source§

fn clip_rounded(self, radius: f32) -> Clip

Source§

fn scale(self, scale: impl Into<Live<f32>>) -> Scaled

Source§

fn rotate(self, degrees: impl Into<Live<f32>>) -> Rotated

Source§

fn width_live(self, width: impl Into<Live<f32>>) -> AnimatedSize

Source§

fn height_live(self, height: impl Into<Live<f32>>) -> AnimatedSize

Source§

fn size_live( self, width: impl Into<Live<f32>>, height: impl Into<Live<f32>>, ) -> AnimatedSize

Source§

fn animate(self, spec: impl Into<AnimSpec>) -> Enter

Source§

fn enter(self, motion: impl Into<Motion>) -> Enter

Source§

fn hover(self, build: impl FnOnce(StatePatch) -> StatePatch) -> States

Source§

fn pressed(self, build: impl FnOnce(StatePatch) -> StatePatch) -> States

Source§

fn focused(self, build: impl FnOnce(StatePatch) -> StatePatch) -> States

Source§

fn selected(self, build: impl FnOnce(StatePatch) -> StatePatch) -> States

Source§

fn disabled(self, build: impl FnOnce(StatePatch) -> StatePatch) -> States

Source§

fn state(self, build: impl FnOnce(States) -> States) -> States

Source§

fn margin(self, margin: impl Into<Edges>) -> Margined

Source§

fn margin_xy(self, x: f32, y: f32) -> Margined

Source§

fn margin_x(self, x: f32) -> Margined

Source§

fn margin_y(self, y: f32) -> Margined

Source§

fn margin_left(self, v: f32) -> Margined

Source§

fn margin_right(self, v: f32) -> Margined

Source§

fn margin_top(self, v: f32) -> Margined

Source§

fn margin_bottom(self, v: f32) -> Margined

Source§

fn indent_top(self, v: f32) -> Margined

Source§

fn indent_bottom(self, v: f32) -> Margined

Source§

fn indent_left(self, v: f32) -> Margined

Source§

fn indent_right(self, v: f32) -> Margined

Source§

fn indent(self, indents: Indents) -> Margined

Source§

fn indent_all(self, v: f32) -> Margined

Source§

fn indent_xy(self, x: f32, y: f32) -> Margined

Source§

fn indent_axes(self, horizontal: f32, vertical: f32) -> Margined