Struct rat_widget::popup_menu::PopupMenu
source · pub struct PopupMenu<'a> { /* private fields */ }Expand description
Popup menu.
Implementations§
source§impl<'a> PopupMenu<'a>
impl<'a> PopupMenu<'a>
sourcepub fn add(self, item: Line<'a>, navchar: Option<char>) -> Self
pub fn add(self, item: Line<'a>, navchar: Option<char>) -> Self
Add a formatted item. The navchar is optional, any markup for it is your problem.
sourcepub fn add_ext(
self,
item: Line<'a>,
navchar: Option<char>,
item_right: Line<'a>,
) -> Self
pub fn add_ext( self, item: Line<'a>, navchar: Option<char>, item_right: Line<'a>, ) -> Self
Add a formatted item. The navchar is optional, any markup for it is your problem.
sourcepub fn add_sep(self, ty: Separator) -> Self
pub fn add_sep(self, ty: Separator) -> Self
Add a separator item. This is added to the item before, so it is not possible to start the menu with a separator, or to add more than one separator.
sourcepub fn add_str(self, txt: &'a str) -> Self
pub fn add_str(self, txt: &'a str) -> Self
Add a text-item. The first underscore is used to denote the navchar.
sourcepub fn width(self, width: u16) -> Self
pub fn width(self, width: u16) -> Self
Fixed width for the menu. If not set it uses 1.5 times the length of the longest item.
sourcepub fn boundary(self, boundary: Rect) -> Self
pub fn boundary(self, boundary: Rect) -> Self
Set outer bounds for the popup-menu. If not used, the buffer-area is used as outer bounds.
sourcepub fn focus_style(self, style: Style) -> Self
pub fn focus_style(self, style: Style) -> Self
Focus/Selection style.
Trait Implementations§
source§impl<'a> StatefulWidget for PopupMenu<'a>
impl<'a> StatefulWidget for PopupMenu<'a>
Auto Trait Implementations§
impl<'a> Freeze for PopupMenu<'a>
impl<'a> RefUnwindSafe for PopupMenu<'a>
impl<'a> Send for PopupMenu<'a>
impl<'a> Sync for PopupMenu<'a>
impl<'a> Unpin for PopupMenu<'a>
impl<'a> UnwindSafe for PopupMenu<'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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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