Trait vizia::modifiers::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 or a lens to some 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 or a lens to some 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 or a lens to some 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 or a lens to some 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);

Object Safety§

This trait is not object safe.

Implementors§

source§

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