pub struct Control { /* private fields */ }Expand description
A handle on the interaction unit a widget belongs to.
Reading any of these subscribes the caller, which is the point: a leaf that asks whether its control is hovered is thereby repainted when it changes.
Implementations§
Source§impl Control
impl Control
Sourcepub fn is_hovered(&self) -> bool
pub fn is_hovered(&self) -> bool
Whether the pointer is inside the control.
A disabled unit is never hovered and never pressed: it refuses the pointer, so it is not under one. The declaration is read first, so a control that is off does not subscribe to flags it would ignore.
Sourcepub fn is_pressed(&self) -> bool
pub fn is_pressed(&self) -> bool
Whether the pointer is down on the control.
Sourcepub fn has_focus(&self) -> bool
pub fn has_focus(&self) -> bool
Whether the keyboard focus is inside the control’s subtree.
The path, rather than a walk of the unit’s descendants: the same
question has to be answerable from a create_derived closure, which has
no tree, and that is where a container resolves the text colour it
publishes below it.
Gated on the declaration, like hover and press: a disabled unit shows no
focus ring, which is what Qt, GTK and a <fieldset disabled> all show.
A field that must go on saying the keyboard is its is not disabled —
it is read-only, which is a
different thing and keeps everything here.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether this unit, and every unit above it, takes input.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
The complement, which is how a state layer reads it.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Control
impl !Sync for Control
impl Freeze for Control
impl RefUnwindSafe for Control
impl Unpin for Control
impl UnsafeUnpin for Control
impl UnwindSafe for Control
Blanket Implementations§
Source§impl<T, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
impl<T, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
Source§fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.