pub struct PressStart {
pub source: PressSource,
pub id: Option<Id>,
/* private fields */
}
Expand description
Details of press start events
This type dereferences to PressSource
.
Fields§
§source: PressSource
Source of the press
id: Option<Id>
Identifier of the widget currently under the press
Implementations§
Source§impl PressStart
impl PressStart
Sourcepub fn grab(&self, id: Id, mode: GrabMode) -> GrabBuilder
pub fn grab(&self, id: Id, mode: GrabMode) -> GrabBuilder
Grab pan/move/press-end events for widget id
There are three types of grab (GrabMode
):
Click
: send the correspondingEvent::PressEnd
onlyGrab
(the default): sendEvent::PressMove
andEvent::PressEnd
- Pan modes: send
Event::Pan
on motion. Note: this is most useful when grabbing multiple touch events.
Only a single mouse grab is allowed at any one time; requesting a
second will cancel the first (sending Event::PressEnd
with
success: false
).
EventState::is_depressed
will return true for the grabbing widget.
Call EventState::set_grab_depress
on PressMove
to update the
grab’s depress target. (This is done automatically for
GrabMode::Click
, and ends automatically when the grab ends.)
This method uses the builder pattern. On completion, Used
is returned. It is expected that the requested press/pan events are all
“used” (Used
).
Sourcepub fn grab_click(&self, id: Id) -> GrabBuilder
pub fn grab_click(&self, id: Id) -> GrabBuilder
Convenience wrapper for Self::grab
using GrabMode::Click
Sourcepub fn grab_move(&self, id: Id) -> GrabBuilder
pub fn grab_move(&self, id: Id) -> GrabBuilder
Convenience wrapper for Self::grab
using GrabMode::Grab
Trait Implementations§
Source§impl AddAssign<Offset> for PressStart
impl AddAssign<Offset> for PressStart
Source§fn add_assign(&mut self, offset: Offset)
fn add_assign(&mut self, offset: Offset)
+=
operation. Read moreSource§impl Clone for PressStart
impl Clone for PressStart
Source§fn clone(&self) -> PressStart
fn clone(&self) -> PressStart
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PressStart
impl Debug for PressStart
Source§impl Deref for PressStart
impl Deref for PressStart
Source§impl PartialEq for PressStart
impl PartialEq for PressStart
impl StructuralPartialEq for PressStart
Auto Trait Implementations§
impl Freeze for PressStart
impl RefUnwindSafe for PressStart
impl !Send for PressStart
impl !Sync for PressStart
impl Unpin for PressStart
impl UnwindSafe for PressStart
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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