pub enum ScrollToMode {
Minimal {
margin: SideOffsets,
},
Center {
widget_point: Point,
scroll_point: Point,
},
}
Expand description
Defines how much the SCROLL_TO_CMD
will scroll to showcase the target widget.
Variants§
Minimal
Scroll will change only just enough so that the widget inner rect is fully visible with the optional extra margin offsets.
Fields
§
margin: SideOffsets
Extra margin added so that the widget is touching the scroll edge.
Center
Scroll so that the point relative to the widget inner rectangle is at the same screen point on the scroll viewport.
Implementations§
source§impl ScrollToMode
impl ScrollToMode
sourcepub fn minimal(margin: impl Into<SideOffsets>) -> Self
pub fn minimal(margin: impl Into<SideOffsets>) -> Self
New Minimal
mode.
sourcepub fn minimal_rect(rect: impl Into<Rect>) -> Self
pub fn minimal_rect(rect: impl Into<Rect>) -> Self
New Minimal
mode.
The minimal scroll needed so that rect
in the content widget is fully visible.
Trait Implementations§
source§impl Clone for ScrollToMode
impl Clone for ScrollToMode
source§fn clone(&self) -> ScrollToMode
fn clone(&self) -> ScrollToMode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScrollToMode
impl Debug for ScrollToMode
source§impl<'de> Deserialize<'de> for ScrollToMode
impl<'de> Deserialize<'de> for ScrollToMode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl IntoVar<Option<ScrollToMode>> for ScrollToMode
impl IntoVar<Option<ScrollToMode>> for ScrollToMode
source§impl PartialEq for ScrollToMode
impl PartialEq for ScrollToMode
source§impl Serialize for ScrollToMode
impl Serialize for ScrollToMode
impl IntoValue<Option<ScrollToMode>> for ScrollToMode
impl StructuralPartialEq for ScrollToMode
Auto Trait Implementations§
impl Freeze for ScrollToMode
impl RefUnwindSafe for ScrollToMode
impl Send for ScrollToMode
impl Sync for ScrollToMode
impl Unpin for ScrollToMode
impl UnwindSafe for ScrollToMode
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more