Skip to main content

PanClaim

Struct PanClaim 

Source
pub struct PanClaim {
    pub axes: PanAxes,
    pub devices: PointerKindMask,
    pub kinetic: bool,
}
Expand description

A node’s declaration that it is a pan surface: it wants to consume a direct pointer’s drag as content panning rather than let it arm a drag/ swipe recognizer or fall through.

Declared independently of TouchAction — a scrollable states “I pan” via PanClaim regardless of what its own touch_action permits; TouchAction is what the arbitration consults to decide whether a claim further down the chain is still reachable. See WidgetTree::pan_candidates.

Declaring a pan claim is orthogonal to having an on_scroll handler: a SpinBox increments on wheel, a TabBar remaps wheel to horizontal tab scroll, and SceneView zooms on Ctrl-wheel — none of those is a pan, and none of them declares a PanClaim. A scroll container declares itself explicitly via scroll_container.

Fields§

§axes: PanAxes

Which axes this surface wants to pan on.

§devices: PointerKindMask

Which pointer kinds this claim applies to. Defaults to PointerKindMask::DIRECT (touch + pen, never mouse) — see the module docs on why a mouse must never be treated as a panning pointer.

§kinetic: bool

Whether a release should hand off to a fling/settle simulation. false by default; scroll_container’s sugar turns it on.

Implementations§

Source§

impl PanClaim

Source

pub fn vertical() -> Self

A vertical-only claim, direct pointers only, no kinetic hand-off.

Source

pub fn horizontal() -> Self

A horizontal-only claim, direct pointers only, no kinetic hand-off.

Source

pub fn both() -> Self

A both-axes claim, direct pointers only, no kinetic hand-off.

Trait Implementations§

Source§

impl Clone for PanClaim

Source§

fn clone(&self) -> PanClaim

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for PanClaim

Source§

impl Debug for PanClaim

Source§

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

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

impl Default for PanClaim

Source§

fn default() -> Self

No axes claimed, PointerKindMask::DIRECT devices, not kinetic. vertical / horizontal / both build on this rather than repeating the device mask.

Source§

impl PartialEq for PanClaim

Source§

fn eq(&self, other: &PanClaim) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PanClaim

Auto Trait Implementations§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.