Skip to main content

AbilityModifiers

Trait AbilityModifiers 

Source
pub trait AbilityModifiers: Modifiable {
    // Provided methods
    fn hoverable<U>(self, state: impl Res<U>) -> Self
       where U: Into<bool> { ... }
    fn focusable<U>(self, state: impl Res<U>) -> Self
       where U: Into<bool> { ... }
    fn checkable<U>(self, state: impl Res<U>) -> Self
       where U: Into<bool> { ... }
    fn navigable<U>(self, state: impl Res<U>) -> Self
       where U: Into<bool> { ... }
}
Expand description

Modifiers for changing the abilities of a view.

Provided Methods§

Source

fn hoverable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be hovered by the mouse and receive mouse events.

Accepts a bool value or signal of type boolean state. Views which cannot be hovered will not receive mouse input events unless the view has captured the mouse input, see cx.capture().

§Example
Label::new(cx, "Hello Vizia")
    .hoverable(false);
Source

fn focusable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be focused to receive keyboard input events.

Accepts a bool value or signal of type boolean state.

§Example
Label::new(cx, "Hello Vizia")
    .focusable(false);
Source

fn checkable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be checked.

Accepts a bool value or signal of type boolean state.

§Example
Label::new(cx, "Hello Vizia")
    .checkable(false);
Source

fn navigable<U>(self, state: impl Res<U>) -> Self
where U: Into<bool>,

Sets whether the view can be navigated to, i.e. focused, by the keyboard.

Accepts a bool value or signal of type boolean state. Navigating to a view with the keyboard gives the view keyboard focus and is typically done with tab and shift + tab key combinations.

§Example
Label::new(cx, "Hello Vizia")
    .checkable(false);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<V> AbilityModifiers for Handle<'_, V>