Trait vizia_core::modifiers::AbilityModifiers

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

Modifiers for changing the abilities of a view.

Provided Methods§

source

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

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: Into<bool>>(self, state: impl Res<U>) -> Self

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: Into<bool>>(self, state: impl Res<U>) -> Self

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: Into<bool>>(self, state: impl Res<U>) -> Self

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>