pub struct PopupMenu<'a> { /* private fields */ }Expand description
Popup menu.
Implementations§
Source§impl<'a> PopupMenu<'a>
impl<'a> PopupMenu<'a>
Sourcepub fn item_parsed(self, text: &'a str) -> Self
pub fn item_parsed(self, text: &'a str) -> Self
Sourcepub fn item_string(self, txt: String) -> Self
pub fn item_string(self, txt: String) -> Self
Add an owned text as item.
Sourcepub fn separator(self, separator: Separator) -> Self
pub fn separator(self, separator: Separator) -> Self
Sets the separator for the last item added. If there is none adds this as an empty menu-item.
Fixed width for the menu. If not set it uses 1.5 times the length of the longest item.
Fixed width for the menu. If not set it uses 1.5 times the length of the longest item.
Sourcepub fn constraint(self, placement: PopupConstraint) -> Self
pub fn constraint(self, placement: PopupConstraint) -> Self
Set relative placement.
Sourcepub fn boundary(self, boundary: Rect) -> Self
pub fn boundary(self, boundary: Rect) -> Self
Set outer bounds for the popup-menu. If not set, the Buffer::area is used as outer bounds.
Sourcepub fn highlight_style(self, style: Style) -> Self
pub fn highlight_style(self, style: Style) -> Self
Highlight style.
Sourcepub fn highlight_style_opt(self, style: Option<Style>) -> Self
pub fn highlight_style_opt(self, style: Option<Style>) -> Self
Highlight style.
Sourcepub fn disabled_style(self, style: Style) -> Self
pub fn disabled_style(self, style: Style) -> Self
Disabled item style.
Sourcepub fn disabled_style_opt(self, style: Option<Style>) -> Self
pub fn disabled_style_opt(self, style: Option<Style>) -> Self
Disabled item style.
Sourcepub fn right_style(self, style: Style) -> Self
pub fn right_style(self, style: Style) -> Self
Style for the hotkey.
Sourcepub fn right_style_opt(self, style: Option<Style>) -> Self
pub fn right_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
Focus/Selection style.
Sourcepub fn focus_style_opt(self, style: Option<Style>) -> Self
pub fn focus_style_opt(self, style: Option<Style>) -> Self
Focus/Selection style.
Sourcepub fn get_block_size(&self) -> Size
pub fn get_block_size(&self) -> Size
Get the padding the block imposes as a Size.
Sourcepub fn get_block_padding(&self) -> Padding
pub fn get_block_padding(&self) -> Padding
Get the padding the block imposes as Padding.
pub fn width(&self) -> u16
pub fn height(&self) -> u16
Trait Implementations§
Source§impl<'a> StatefulWidget for &PopupMenu<'a>
impl<'a> StatefulWidget for &PopupMenu<'a>
Source§impl StatefulWidget for PopupMenu<'_>
impl StatefulWidget for PopupMenu<'_>
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§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