Struct zng::mouse::MouseHoverArgs
source · pub struct MouseHoverArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: Option<DeviceId>,
pub position: Point2D<Dip, Dip>,
pub hits: HitTestInfo,
pub prev_target: Option<InteractionPath>,
pub target: Option<InteractionPath>,
pub prev_capture: Option<CaptureInfo>,
pub capture: Option<CaptureInfo>,
/* private fields */
}
Expand description
MOUSE_HOVERED_EVENT
arguments.
Fields§
§timestamp: DInstant
Instant the event happened.
window_id: WindowId
Id of window that received the event.
device_id: Option<DeviceId>
Id of device that generated the event.
position: Point2D<Dip, Dip>
Position of the mouse in the window.
hits: HitTestInfo
Hit-test result for the mouse point in the window.
prev_target: Option<InteractionPath>
Previous top-most hit before the mouse moved.
target: Option<InteractionPath>
Full path to the top-most hit in hits
.
Is None
when the mouse moves out of a window or the window closes under the mouse
and there was a previous hovered widget.
prev_capture: Option<CaptureInfo>
Previous pointer capture.
capture: Option<CaptureInfo>
Current pointer capture.
Implementations§
source§impl MouseHoverArgs
impl MouseHoverArgs
sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<Option<DeviceId>>,
position: impl Into<Point2D<Dip, Dip>>,
hits: impl Into<HitTestInfo>,
prev_target: impl Into<Option<InteractionPath>>,
target: impl Into<Option<InteractionPath>>,
prev_capture: impl Into<Option<CaptureInfo>>,
capture: impl Into<Option<CaptureInfo>>,
) -> MouseHoverArgs
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, position: impl Into<Point2D<Dip, Dip>>, hits: impl Into<HitTestInfo>, prev_target: impl Into<Option<InteractionPath>>, target: impl Into<Option<InteractionPath>>, prev_capture: impl Into<Option<CaptureInfo>>, capture: impl Into<Option<CaptureInfo>>, ) -> MouseHoverArgs
New args from values that convert into the argument types.
sourcepub fn now(
window_id: impl Into<WindowId>,
device_id: impl Into<Option<DeviceId>>,
position: impl Into<Point2D<Dip, Dip>>,
hits: impl Into<HitTestInfo>,
prev_target: impl Into<Option<InteractionPath>>,
target: impl Into<Option<InteractionPath>>,
prev_capture: impl Into<Option<CaptureInfo>>,
capture: impl Into<Option<CaptureInfo>>,
) -> MouseHoverArgs
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<Option<DeviceId>>, position: impl Into<Point2D<Dip, Dip>>, hits: impl Into<HitTestInfo>, prev_target: impl Into<Option<InteractionPath>>, target: impl Into<Option<InteractionPath>>, prev_capture: impl Into<Option<CaptureInfo>>, capture: impl Into<Option<CaptureInfo>>, ) -> MouseHoverArgs
Arguments for event that happened now (INSTANT.now
).
source§impl MouseHoverArgs
impl MouseHoverArgs
sourcepub fn capture_allows(&self) -> bool
pub fn capture_allows(&self) -> bool
sourcepub fn is_mouse_move(&self) -> bool
pub fn is_mouse_move(&self) -> bool
Event caused by the mouse position moving over/out of the widget bounds.
sourcepub fn is_widget_move(&self) -> bool
pub fn is_widget_move(&self) -> bool
Event caused by the widget moving under/out of the mouse position.
sourcepub fn is_capture_change(&self) -> bool
pub fn is_capture_change(&self) -> bool
Event caused by a pointer capture change.
sourcepub fn is_mouse_enter(&self) -> bool
pub fn is_mouse_enter(&self) -> bool
Returns true
if the WIDGET
was not hovered, but now is.
sourcepub fn is_mouse_leave(&self) -> bool
pub fn is_mouse_leave(&self) -> bool
Returns true
if the WIDGET
was hovered, but now isn’t.
sourcepub fn is_mouse_enter_enabled(&self) -> bool
pub fn is_mouse_enter_enabled(&self) -> bool
Returns true
if the WIDGET
was not hovered or was disabled, but now is hovered and enabled.
sourcepub fn is_mouse_leave_enabled(&self) -> bool
pub fn is_mouse_leave_enabled(&self) -> bool
Returns true
if the WIDGET
was hovered and enabled, but now is not hovered or is disabled.
sourcepub fn is_mouse_enter_disabled(&self) -> bool
pub fn is_mouse_enter_disabled(&self) -> bool
Returns true
if the WIDGET
was not hovered or was enabled, but now is hovered and disabled.
sourcepub fn is_mouse_leave_disabled(&self) -> bool
pub fn is_mouse_leave_disabled(&self) -> bool
Returns true
if the WIDGET
was hovered and disabled, but now is not hovered or is enabled.
sourcepub fn was_over(&self) -> bool
pub fn was_over(&self) -> bool
Returns true
if the WIDGET
is in prev_target
and is allowed by the prev_capture
.
sourcepub fn was_enabled(&self, widget_id: WidgetId) -> bool
pub fn was_enabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget was enabled in prev_target
.
sourcepub fn was_disabled(&self, widget_id: WidgetId) -> bool
pub fn was_disabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget was disabled in prev_target
.
sourcepub fn is_enabled(&self, widget_id: WidgetId) -> bool
pub fn is_enabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget is enabled in target
.
sourcepub fn is_disabled(&self, widget_id: WidgetId) -> bool
pub fn is_disabled(&self, widget_id: WidgetId) -> bool
Returns true
if the widget is disabled in target
.
sourcepub fn position_wgt(&self) -> Option<Point2D<Px, Px>>
pub fn position_wgt(&self) -> Option<Point2D<Px, Px>>
Gets position in the widget inner bounds.
Trait Implementations§
source§impl AnyEventArgs for MouseHoverArgs
impl AnyEventArgs for MouseHoverArgs
source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
The target
, prev_target
and capture
.
source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
source§impl Clone for MouseHoverArgs
impl Clone for MouseHoverArgs
source§fn clone(&self) -> MouseHoverArgs
fn clone(&self) -> MouseHoverArgs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MouseHoverArgs
impl Debug for MouseHoverArgs
Auto Trait Implementations§
impl Freeze for MouseHoverArgs
impl RefUnwindSafe for MouseHoverArgs
impl Send for MouseHoverArgs
impl Sync for MouseHoverArgs
impl Unpin for MouseHoverArgs
impl UnwindSafe for MouseHoverArgs
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<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)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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