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§
sourcefn hoverable<U>(self, state: impl Res<U>) -> Self
fn hoverable<U>(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);
sourcefn focusable<U>(self, state: impl Res<U>) -> Self
fn focusable<U>(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);
sourcefn checkable<U>(self, state: impl Res<U>) -> Self
fn checkable<U>(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);
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);