Struct kas::event::config::WindowConfig
source · pub struct WindowConfig { /* private fields */ }
Expand description
Wrapper around Config
to handle window-specific scaling
Implementations§
source§impl WindowConfig
impl WindowConfig
Delay before opening/closing menus on mouse hover
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 scroll_flick_timeout(&self) -> Duration
pub fn scroll_flick_timeout(&self) -> Duration
Controls activation of glide/momentum scrolling
This is the maximum time between the last press-movement and final
release to activate momentum scrolling mode. The last few PressMove
events within this time window are used to calculate the initial speed.
sourcepub fn scroll_flick_decay(&self) -> (f32, f32)
pub fn scroll_flick_decay(&self) -> (f32, f32)
Scroll flick velocity 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 scroll_distance(&self, lines: (f32, f32)) -> Offset
pub fn scroll_distance(&self, lines: (f32, f32)) -> Offset
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_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 Clone for WindowConfig
impl Clone for WindowConfig
source§fn clone(&self) -> WindowConfig
fn clone(&self) -> WindowConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WindowConfig
impl !Send for WindowConfig
impl !Sync for WindowConfig
impl Unpin for WindowConfig
impl !UnwindSafe for WindowConfig
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
§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
§fn cast_approx(self) -> T
fn cast_approx(self) -> T
§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
§fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
§fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
§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.