Skip to main content

Scroll

Struct Scroll 

Source
pub struct Scroll<'a, T> {
    pub state: &'a mut ScrollState<T>,
    pub axis: Axis,
    pub animation: Animation,
    pub scroll_speed: f32,
    pub inertia_friction: f32,
    pub minimum_thumb_extent: T,
    pub floating: bool,
}
Expand description

use for arbitrary content such as forms and small collections builds all content every frame

Fields§

§state: &'a mut ScrollState<T>§axis: Axis§animation: Animation§scroll_speed: f32§inertia_friction: f32§minimum_thumb_extent: T§floating: bool

scrollbars cover the content instead of taking space beside it

Implementations§

Source§

impl<'a, T> Scroll<'a, T>
where T: Scalar,

Source

pub fn new(state: &'a mut ScrollState<T>) -> Scroll<'a, T>

creates a new Scroll

Source

pub fn state(self, value: &'a mut ScrollState<T>) -> Scroll<'a, T>

Source

pub fn axis(self, value: Axis) -> Scroll<'a, T>

Source

pub fn animation(self, value: impl Into<Animation>) -> Scroll<'a, T>

Source

pub fn scroll_speed(self, value: f32) -> Scroll<'a, T>

Source

pub fn inertia_friction(self, value: f32) -> Scroll<'a, T>

Source

pub fn minimum_thumb_extent(self, value: T) -> Scroll<'a, T>

Source

pub fn floating(self, value: bool) -> Scroll<'a, T>

Source§

impl<'state, T> Scroll<'state, T>
where T: Scalar,

Source

pub fn begin<'ui, C, S>( self, ui: Ui<'ui, C, S>, ) -> ScrollContent<'state, 'ui, C>
where C: Context<Scalar = T>, S: NoLayout,

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for Scroll<'a, T>

§

impl<'a, T> Forget for Scroll<'a, T>

§

impl<'a, T> Freeze for Scroll<'a, T>
where &'a mut ScrollState<T>: Freeze, T: Freeze,

§

impl<'a, T> Move for Scroll<'a, T>

§

impl<'a, T> RefUnwindSafe for Scroll<'a, T>

§

impl<'a, T> Send for Scroll<'a, T>
where T: Send, NonZero<u32>: Send,

§

impl<'a, T> Sync for Scroll<'a, T>
where T: Sync, NonZero<u32>: Sync,

§

impl<'a, T> Unpin for Scroll<'a, T>
where T: Unpin, &'a mut ScrollState<T>: Unpin,

§

impl<'a, T> UnsafeUnpin for Scroll<'a, T>
where &'a mut ScrollState<T>: UnsafeUnpin, T: UnsafeUnpin,

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> 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, 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.