pub struct Help { /* private fields */ }Expand description
Help widget that renders keybinding entries.
In HelpMode::Short mode, entries are shown inline separated by a bullet
character, truncated with an ellipsis if they exceed the available width.
In HelpMode::Full mode, entries are rendered in a vertical list with
keys and descriptions in aligned columns.
Implementations§
Source§impl Help
impl Help
Sourcepub fn entry(self, key: impl Into<String>, desc: impl Into<String>) -> Self
pub fn entry(self, key: impl Into<String>, desc: impl Into<String>) -> Self
Add an entry to the help widget.
Sourcepub fn with_entry(self, entry: HelpEntry) -> Self
pub fn with_entry(self, entry: HelpEntry) -> Self
Add a pre-built entry.
Sourcepub fn with_entries(self, entries: Vec<HelpEntry>) -> Self
pub fn with_entries(self, entries: Vec<HelpEntry>) -> Self
Set all entries at once.
Sourcepub fn with_separator(self, sep: impl Into<String>) -> Self
pub fn with_separator(self, sep: impl Into<String>) -> Self
Set the separator used between entries in short mode.
Sourcepub fn with_ellipsis(self, ellipsis: impl Into<String>) -> Self
pub fn with_ellipsis(self, ellipsis: impl Into<String>) -> Self
Set the ellipsis string.
Sourcepub fn with_key_style(self, style: Style) -> Self
pub fn with_key_style(self, style: Style) -> Self
Set the style for key text.
Sourcepub fn with_desc_style(self, style: Style) -> Self
pub fn with_desc_style(self, style: Style) -> Self
Set the style for description text.
Sourcepub fn with_separator_style(self, style: Style) -> Self
pub fn with_separator_style(self, style: Style) -> Self
Set the style for separators and ellipsis.
Sourcepub fn toggle_mode(&mut self)
pub fn toggle_mode(&mut self)
Toggle between short and full mode.
Sourcepub fn push_entry(&mut self, entry: HelpEntry)
pub fn push_entry(&mut self, entry: HelpEntry)
Add an entry mutably.
Trait Implementations§
Source§impl StatefulWidget for Help
impl StatefulWidget for Help
Auto Trait Implementations§
impl Freeze for Help
impl RefUnwindSafe for Help
impl Send for Help
impl Sync for Help
impl Unpin for Help
impl UnsafeUnpin for Help
impl UnwindSafe for Help
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