Struct egui::containers::scroll_area::State

source ·
pub struct State {
    pub offset: Vec2,
    offset_target: [Option<ScrollTarget>; 2],
    show_scroll: Vec2b,
    content_is_too_large: Vec2b,
    scroll_bar_interaction: Vec2b,
    vel: Vec2,
    scroll_start_offset_from_top_left: [Option<f32>; 2],
    scroll_stuck_to_end: Vec2b,
    interact_rect: Option<Rect>,
}

Fields§

§offset: Vec2

Positive offset means scrolling down/right

§offset_target: [Option<ScrollTarget>; 2]

If set, quickly but smoothly scroll to this target offset.

§show_scroll: Vec2b

Were the scroll bars visible last frame?

§content_is_too_large: Vec2b

The content were to large to fit large frame.

§scroll_bar_interaction: Vec2b

Did the user interact (hover or drag) the scroll bars last frame?

§vel: Vec2

Momentum, used for kinetic scrolling

§scroll_start_offset_from_top_left: [Option<f32>; 2]

Mouse offset relative to the top of the handle when started moving the handle.

§scroll_stuck_to_end: Vec2b

Is the scroll sticky. This is true while scroll handle is in the end position and remains that way until the user moves the scroll_handle. Once unstuck (false) it remains false until the scroll touches the end position, which reenables stickiness.

§interact_rect: Option<Rect>

Area that can be dragged. This is the size of the content from the last frame.

Implementations§

source§

impl State

source

pub fn load(ctx: &Context, id: Id) -> Option<Self>

source

pub fn store(self, ctx: &Context, id: Id)

source

pub fn velocity(&self) -> Vec2

Get the current kinetic scrolling velocity.

Trait Implementations§

source§

impl Clone for State

source§

fn clone(&self) -> State

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for State

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for State

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for State

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

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> ToOwned for T
where T: Clone,

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,