pub struct WindowAffordanceEvent {
pub kind: WindowAffordanceKind,
pub phase: WindowAffordanceDragPhase,
pub position: Point,
pub delta: Offset,
pub total_delta: Offset,
}Expand description
Provider-neutral chrome interaction emitted in screen logical pixels.
delta is relative to the previous drag event and total_delta is relative
to the drag start. Clicks use zero offsets.
§Examples
use ailloli_ui_core::{Offset, Point};
use ailloli_ui_widgets::chrome::{WindowAffordanceDragPhase, WindowAffordanceEvent, WindowAffordanceKind};
let event = WindowAffordanceEvent {
kind: WindowAffordanceKind::Move,
phase: WindowAffordanceDragPhase::Drag,
position: Point::new(12.0, 8.0),
delta: Offset::new(2.0, 0.0),
total_delta: Offset::new(4.0, 1.0),
};
assert_eq!(event.delta.x, 2.0);Fields§
§kind: WindowAffordanceKindOperation selected by hit testing.
phase: WindowAffordanceDragPhasePress/drag/release/click lifecycle phase.
position: PointCurrent pointer position in screen logical pixels.
delta: OffsetLogical-pixel displacement since the previous event.
total_delta: OffsetLogical-pixel displacement since drag start.
Trait Implementations§
Source§impl Clone for WindowAffordanceEvent
impl Clone for WindowAffordanceEvent
Source§fn clone(&self) -> WindowAffordanceEvent
fn clone(&self) -> WindowAffordanceEvent
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 WindowAffordanceEvent
impl Debug for WindowAffordanceEvent
Source§impl PartialEq for WindowAffordanceEvent
impl PartialEq for WindowAffordanceEvent
impl Copy for WindowAffordanceEvent
impl StructuralPartialEq for WindowAffordanceEvent
Auto Trait Implementations§
impl Freeze for WindowAffordanceEvent
impl RefUnwindSafe for WindowAffordanceEvent
impl Send for WindowAffordanceEvent
impl Sync for WindowAffordanceEvent
impl Unpin for WindowAffordanceEvent
impl UnwindSafe for WindowAffordanceEvent
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> 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>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.