Struct iced_native::widget::scrollable::State
source · pub struct State { /* private fields */ }
Expand description
The local state of a Scrollable
.
Implementations§
source§impl State
impl State
sourcepub fn scroll(
&mut self,
delta: Vector<f32>,
bounds: Rectangle,
content_bounds: Rectangle
)
pub fn scroll( &mut self, delta: Vector<f32>, bounds: Rectangle, content_bounds: Rectangle )
Apply a scrolling offset to the current State
, given the bounds of
the Scrollable
and its contents.
sourcepub fn scroll_y_to(
&mut self,
percentage: f32,
bounds: Rectangle,
content_bounds: Rectangle
)
pub fn scroll_y_to( &mut self, percentage: f32, bounds: Rectangle, content_bounds: Rectangle )
Scrolls the Scrollable
to a relative amount along the y axis.
0
represents scrollbar at the beginning, while 1
represents scrollbar at
the end.
sourcepub fn scroll_x_to(
&mut self,
percentage: f32,
bounds: Rectangle,
content_bounds: Rectangle
)
pub fn scroll_x_to( &mut self, percentage: f32, bounds: Rectangle, content_bounds: Rectangle )
Scrolls the Scrollable
to a relative amount along the x axis.
0
represents scrollbar at the beginning, while 1
represents scrollbar at
the end.
sourcepub fn snap_to(&mut self, offset: RelativeOffset)
pub fn snap_to(&mut self, offset: RelativeOffset)
Snaps the scroll position to a RelativeOffset
.
sourcepub fn unsnap(&mut self, bounds: Rectangle, content_bounds: Rectangle)
pub fn unsnap(&mut self, bounds: Rectangle, content_bounds: Rectangle)
Unsnaps the current scroll position, if snapped, given the bounds of the
Scrollable
and its contents.
sourcepub fn offset(&self, bounds: Rectangle, content_bounds: Rectangle) -> Vector
pub fn offset(&self, bounds: Rectangle, content_bounds: Rectangle) -> Vector
Returns the scrolling offset of the State
, given the bounds of the
Scrollable
and its contents.
sourcepub fn scrollers_grabbed(&self) -> bool
pub fn scrollers_grabbed(&self) -> bool
Returns whether any scroller is currently grabbed or not.
Trait Implementations§
source§impl Scrollable for State
impl Scrollable for State
source§fn snap_to(&mut self, offset: RelativeOffset)
fn snap_to(&mut self, offset: RelativeOffset)
Snaps the scroll of the widget to the given
percentage
along the horizontal & vertical axis.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§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more