pub struct Caption<'a> { /* private fields */ }Expand description
A label/caption linked to another widget.
*** unstable ***
Implementations§
Source§impl<'a> Caption<'a>
impl<'a> Caption<'a>
Sourcepub fn parse(txt: &'a str) -> Self
pub fn parse(txt: &'a str) -> Self
Uses ‘_’ as special character.
Item
The first ‘_’ marks the navigation-char. Pipe ‘|’ separates the item text and the hotkey text.
Sourcepub fn text(self, txt: &'a str) -> Self
pub fn text(self, txt: &'a str) -> Self
Set the label text.
You probably want to use parse instead. This is only useful if you want manual control over highlight-range and hotkey text.
Sourcepub fn hotkey_text(self, hotkey: &'a str) -> Self
pub fn hotkey_text(self, hotkey: &'a str) -> Self
Hotkey text
Sourcepub fn hotkey_align(self, align: HotkeyAlignment) -> Self
pub fn hotkey_align(self, align: HotkeyAlignment) -> Self
Alignment of the hotkey text.
Sourcepub fn hotkey_policy(self, policy: HotkeyPolicy) -> Self
pub fn hotkey_policy(self, policy: HotkeyPolicy) -> Self
Policy for when to show the hotkey text.
Navigation-char.
Sourcepub fn styles(self, styles: CaptionStyle) -> Self
pub fn styles(self, styles: CaptionStyle) -> Self
Set all styles.
Sourcepub fn hover_style(self, style: Style) -> Self
pub fn hover_style(self, style: Style) -> Self
Hover style.
Sourcepub fn highlight_style(self, style: Style) -> Self
pub fn highlight_style(self, style: Style) -> Self
Shortcut highlight style.
Sourcepub fn highlight_style_opt(self, style: Option<Style>) -> Self
pub fn highlight_style_opt(self, style: Option<Style>) -> Self
Shortcut highlight style.
Sourcepub fn hotkey_style(self, style: Style) -> Self
pub fn hotkey_style(self, style: Style) -> Self
Style for the hotkey.
Sourcepub fn hotkey_style_opt(self, style: Option<Style>) -> Self
pub fn hotkey_style_opt(self, style: Option<Style>) -> Self
Style for the hotkey.
Sourcepub fn focus_style(self, style: Style) -> Self
pub fn focus_style(self, style: Style) -> Self
Base-style when the main widget is focused.
Sourcepub fn focus_style_opt(self, style: Option<Style>) -> Self
pub fn focus_style_opt(self, style: Option<Style>) -> Self
Base-style when the main widget is focused.
Sourcepub fn text_width(&self) -> u16
pub fn text_width(&self) -> u16
Inherent width
Sourcepub fn hotkey_width(&self) -> u16
pub fn hotkey_width(&self) -> u16
Inherent width
Trait Implementations§
Source§impl<'a> StatefulWidget for &Caption<'a>
impl<'a> StatefulWidget for &Caption<'a>
Source§impl<'a> StatefulWidget for Caption<'a>
impl<'a> StatefulWidget for Caption<'a>
Auto Trait Implementations§
impl<'a> Freeze for Caption<'a>
impl<'a> !RefUnwindSafe for Caption<'a>
impl<'a> !Send for Caption<'a>
impl<'a> !Sync for Caption<'a>
impl<'a> Unpin for Caption<'a>
impl<'a> !UnwindSafe for Caption<'a>
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