pub struct EventWindowConfig<'a>(/* private fields */);
Expand description
Accessor to event configuration
This is a helper to read event configuration, adapted for the current application and window scale.
Implementations§
Source§impl<'a> EventWindowConfig<'a>
impl<'a> EventWindowConfig<'a>
Sourcepub fn base(&self) -> Ref<'_, EventConfig>
pub fn base(&self) -> Ref<'_, EventConfig>
Access base (unscaled) event EventConfig
Sourcepub fn hover_delay(&self) -> Duration
pub fn hover_delay(&self) -> Duration
Delay before mouse hover action (show tooltip)
Delay before opening/closing menus on mouse over
Sourcepub fn touch_select_delay(&self) -> Duration
pub fn touch_select_delay(&self) -> Duration
Delay before switching from panning to (text) selection mode
Sourcepub fn kinetic_timeout(&self) -> Duration
pub fn kinetic_timeout(&self) -> Duration
Controls activation of kinetic scrolling
This is the maximum time between the last press-movement and final
release to activate kinetic scrolling mode. The last few PressMove
events within this time window are used to calculate the initial speed.
Sourcepub fn kinetic_decay(&self) -> (f32, f32)
pub fn kinetic_decay(&self) -> (f32, f32)
Kinetic scrolling decay: (mul, sub)
The mul
factor describes exponential decay: effectively, velocity is
multiplied by mul
every second. This is the dominant decay factor at
high speeds; mul = 1.0
implies no decay while mul = 0.0
implies an
instant stop.
The sub
factor describes linear decay: effectively, speed is reduced
by sub
every second. This is the dominant decay factor at low speeds.
Units are pixels/second (output is adjusted for the window’s scale factor).
Sourcepub fn kinetic_grab_sub(&self) -> f32
pub fn kinetic_grab_sub(&self) -> f32
Kinetic scrolling decay while grabbed: sub
When a kinetic-scrolling element is grabbed while in motion, speed
relative to the grab velocity is reduced by this value each second.
This is applied in addition to the usual velocity decay (see
Self::kinetic_decay
).
Sourcepub fn scroll_distance(&self, lines: (f32, f32)) -> Vec2
pub fn scroll_distance(&self, lines: (f32, f32)) -> Vec2
Get distance in pixels to scroll due to mouse wheel
Calculates scroll distance from (horiz, vert)
lines.
Sourcepub fn pan_dist_thresh(&self) -> f32
pub fn pan_dist_thresh(&self) -> f32
Drag distance threshold before panning (scrolling) starts
When the distance moved is greater than this threshold, panning should start; otherwise the system should wait for the text-selection timer. We currently recommend the L-inf distance metric (max of abs of values).
Units are pixels (output is adjusted for the window’s scale factor).
Sourcepub fn mouse_wheel_actions(&self) -> bool
pub fn mouse_wheel_actions(&self) -> bool
Whether the mouse wheel may trigger actions such as switching to the next item in a list
Sourcepub fn mouse_pan(&self) -> MousePan
pub fn mouse_pan(&self) -> MousePan
When to pan general widgets (unhandled events) with the mouse
Sourcepub fn mouse_text_pan(&self) -> MousePan
pub fn mouse_text_pan(&self) -> MousePan
When to pan text fields with the mouse
Whether mouse clicks set keyboard navigation focus
Whether touchscreen events set keyboard navigation focus
Trait Implementations§
Source§impl<'a> Clone for EventWindowConfig<'a>
impl<'a> Clone for EventWindowConfig<'a>
Source§fn clone(&self) -> EventWindowConfig<'a>
fn clone(&self) -> EventWindowConfig<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for EventWindowConfig<'a>
impl<'a> !RefUnwindSafe for EventWindowConfig<'a>
impl<'a> !Send for EventWindowConfig<'a>
impl<'a> !Sync for EventWindowConfig<'a>
impl<'a> Unpin for EventWindowConfig<'a>
impl<'a> !UnwindSafe for EventWindowConfig<'a>
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