pub struct KeyHints { /* private fields */ }Expand description
A bar of key hints such as tab next ctrl q quit, fed from the keymap and from hints
the application adds for the current screen.
Keys sit on a raised surface and labels are faint; nothing is bracketed. When the bar is
too narrow, hints are dropped from the end of the left group first; the right group stays.
Style keys: key-hints (bg, padding), key-hint-key, key-hint-label.
Implementations§
Source§impl KeyHints
impl KeyHints
Sourcepub fn hint(self, key: impl Into<String>, label: impl Into<String>) -> Self
pub fn hint(self, key: impl Into<String>, label: impl Into<String>) -> Self
Adds a hint on the left: key such as "↑↓" and its label.
Sourcepub fn action(self, scope: Scope, action: impl Into<String>) -> Self
pub fn action(self, scope: Scope, action: impl Into<String>) -> Self
Adds a keymap action on the left; its keys and translated label come from the keymap and the locale.
Sourcepub fn action_right(self, scope: Scope, action: impl Into<String>) -> Self
pub fn action_right(self, scope: Scope, action: impl Into<String>) -> Self
Adds a keymap action on the right.
Trait Implementations§
Source§impl<Msg: 'static> Widget<Msg> for KeyHints
impl<Msg: 'static> Widget<Msg> for KeyHints
Source§fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, _cx: &mut MeasureCx<'_>, available: Size) -> Size
The size the widget wants when it may use up to
available.Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
Draws the widget’s overlay after the whole view was painted, when it asked for one with
PaintCx::request_overlay. anchor is the area the widget was painted in.Source§fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
fn event(&self, _cx: &mut EventCx<'_, Msg>, _event: &Event) -> bool
Handles input. Returns
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Mutable child nodes, used to assign ids.
Auto Trait Implementations§
impl Freeze for KeyHints
impl RefUnwindSafe for KeyHints
impl Send for KeyHints
impl Sync for KeyHints
impl Unpin for KeyHints
impl UnsafeUnpin for KeyHints
impl UnwindSafe for KeyHints
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more