pub struct State { /* private fields */ }Expand description
The local state of a Scrollable.
Implementations
sourceimpl State
impl State
sourcepub fn scroll(
&mut self,
delta_y: f32,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
)
pub fn scroll(
&mut self,
delta_y: f32,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
)
Apply a scrolling offset to the current State, given the bounds of
the Scrollable and its contents.
sourcepub fn scroll_to(
&mut self,
percentage: f32,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
)
pub fn scroll_to(
&mut self,
percentage: f32,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
)
Moves the scroll position to a relative amount, given the bounds of
the Scrollable and its contents.
0 represents scrollbar at the top, while 1 represents scrollbar at
the bottom.
sourcepub fn offset(
&self,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
) -> u32
pub fn offset(
&self,
bounds: Rectangle<f32>,
content_bounds: Rectangle<f32>
) -> u32
Returns the current scrolling offset of the State, given the bounds
of the Scrollable and its contents.
sourcepub fn is_scroller_grabbed(&self) -> bool
pub fn is_scroller_grabbed(&self) -> bool
Returns whether the scroller is currently grabbed or not.
sourcepub fn is_scroll_box_touched(&self) -> bool
pub fn is_scroll_box_touched(&self) -> bool
Returns whether the scroll box is currently touched or not.
Trait Implementations
impl Copy for State
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value as a parameter of self.