pub struct ActionMenu { /* private fields */ }Expand description
The action menu: a stack of pages, a query per page, and the last-drawn window offset so pointer hit-testing agrees with what was rendered.
Implementations§
Source§impl ActionMenu
impl ActionMenu
pub fn new(items: Vec<ActionMenuItem>) -> Self
pub fn items(&self) -> &[ActionMenuItem]
pub fn query(&self) -> &str
pub fn is_fuzzy(&self) -> bool
pub fn visible_len(&self) -> usize
Sourcepub fn selected_position(&self) -> usize
pub fn selected_position(&self) -> usize
The cursor’s position in the filtered list.
pub fn selected_item(&self) -> Option<&ActionMenuItem>
pub fn item(&self, index: usize) -> Option<&ActionMenuItem>
Sourcepub fn push(&mut self, title: impl Into<String>, items: Vec<ActionMenuItem>)
pub fn push(&mut self, title: impl Into<String>, items: Vec<ActionMenuItem>)
Push a submenu. Its own query starts empty, so the parent filter does not silently hide rows in a list the reader has not seen yet.
pub fn title(&self) -> &str
pub fn handle_key(&mut self, key: KeyEvent) -> MenuEvent
Sourcepub fn bounds(&self, area: Rect) -> Rect
pub fn bounds(&self, area: Rect) -> Rect
The popup rect for area, size clamped to the content and the area.
pub fn window_offset(&self) -> usize
Trait Implementations§
Source§impl Clone for ActionMenu
impl Clone for ActionMenu
Auto Trait Implementations§
impl !Freeze for ActionMenu
impl !RefUnwindSafe for ActionMenu
impl !Sync for ActionMenu
impl Send for ActionMenu
impl Unpin for ActionMenu
impl UnsafeUnpin for ActionMenu
impl UnwindSafe for ActionMenu
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