pub enum DragScroll {
Never,
OnTouch,
Always,
}Expand description
When ScrollArea should let the user scroll by dragging the content.
Variants§
Never
Never scroll on pointer drag.
OnTouch
Only allow drag-to-scroll when a touch screen is detected
(see crate::InputState::has_touch_screen). The recommended default.
Always
Always allow drag-to-scroll, even with a mouse.
Implementations§
Source§impl DragScroll
impl DragScroll
Sourcepub fn enabled(self, ctx: &Context) -> bool
pub fn enabled(self, ctx: &Context) -> bool
Whether drag-to-scroll is currently active.
Checks if we have a touch screen (via crate::InputState::has_touch_screen)
when self is Self::OnTouch.
Trait Implementations§
Source§impl BitOr for DragScroll
impl BitOr for DragScroll
Source§impl Clone for DragScroll
impl Clone for DragScroll
Source§fn clone(&self) -> DragScroll
fn clone(&self) -> DragScroll
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DragScroll
Source§impl Debug for DragScroll
impl Debug for DragScroll
Source§impl Default for DragScroll
impl Default for DragScroll
Source§fn default() -> DragScroll
fn default() -> DragScroll
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DragScroll
impl<'de> Deserialize<'de> for DragScroll
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
impl Eq for DragScroll
Source§impl PartialEq for DragScroll
impl PartialEq for DragScroll
Source§fn eq(&self, other: &DragScroll) -> bool
fn eq(&self, other: &DragScroll) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DragScroll
impl Serialize for DragScroll
impl StructuralPartialEq for DragScroll
Auto Trait Implementations§
impl Freeze for DragScroll
impl RefUnwindSafe for DragScroll
impl Send for DragScroll
impl Sync for DragScroll
impl Unpin for DragScroll
impl UnsafeUnpin for DragScroll
impl UnwindSafe for DragScroll
Blanket Implementations§
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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