Struct WindowZoom
pub struct WindowZoom { /* private fields */ }Expand description
A window’s content zoom: its factor, where it is remembered, the level the window’s bar says after a change, and the scroll and pinch it accumulates into steps.
Implementations§
§impl WindowZoom
impl WindowZoom
pub fn restore_for_app(&mut self, app_id: &str) -> bool
pub fn restore_for_app(&mut self, app_id: &str) -> bool
Remember the factor in app_id’s settings on this device, and take
up the one stored there. Returns whether the factor changed.
pub fn in_window(&self) -> bool
pub fn in_window(&self) -> bool
Whether a window a person sees has this zoom: one was opened for an
app (Self::restore_for_app). A test’s or a host worker’s app has
no window to zoom.
pub fn step(&mut self, step: ZoomStep, now: Instant) -> bool
pub fn step(&mut self, step: ZoomStep, now: Instant) -> bool
Take step on the window’s own scale: remember it and show the
indicator. Returns whether the factor changed.
pub fn indicate(&mut self, factor: f32, _now: Instant)
pub fn indicate(&mut self, factor: f32, _now: Instant)
Say the level factor in the window’s bar (a widget’s own zoom
says its level the same way); the same level again (a step at a
bound) says it once more.
pub fn indicator_visible(&self, _now: Instant) -> bool
pub fn indicator_visible(&self, _now: Instant) -> bool
Whether the window’s bar says the level.
pub fn publish(&mut self)
pub fn publish(&mut self)
Keep the window’s bar saying the level while it lasts, and let it go
once its time is up; the host calls this on its frames and at
Self::deadline.
pub fn deadline(&self) -> Option<Instant>
pub fn deadline(&self) -> Option<Instant>
When the level leaves the window’s bar, for the host’s wake.
pub fn step_of(&mut self, gesture: ZoomGesture) -> Option<ZoomStep>
pub fn step_of(&mut self, gesture: ZoomGesture) -> Option<ZoomStep>
The step gesture amounts to, if any yet.
pub fn scroll_step(&mut self, delta: &MouseScrollDelta) -> Option<ZoomStep>
pub fn scroll_step(&mut self, delta: &MouseScrollDelta) -> Option<ZoomStep>
A Ctrl+scroll: the step it adds up to, if any. A wheel notch is a step; a touchpad’s pixels add up to one.
pub fn pinch_step(&mut self, delta: f64, phase: TouchPhase) -> Option<ZoomStep>
pub fn pinch_step(&mut self, delta: f64, phase: TouchPhase) -> Option<ZoomStep>
A touchpad pinch’s change of scale: the step it adds up to, if any.
Trait Implementations§
§impl Debug for WindowZoom
impl Debug for WindowZoom
§impl Default for WindowZoom
impl Default for WindowZoom
§fn default() -> WindowZoom
fn default() -> WindowZoom
Auto Trait Implementations§
impl !Freeze for WindowZoom
impl !RefUnwindSafe for WindowZoom
impl Send for WindowZoom
impl !Sync for WindowZoom
impl Unpin for WindowZoom
impl UnsafeUnpin for WindowZoom
impl UnwindSafe for WindowZoom
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<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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend 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> 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