pub struct MenuBar {
pub items: Vec<MenuItem>,
pub area: Option<Rect>,
pub normal_style: Style,
pub selected_style: Style,
pub hover_style: Style,
pub selected_hover_style: Style,
}Available on crate feature
menu-bar only.Fields§
§items: Vec<MenuItem>§area: Option<Rect>§normal_style: Style§selected_style: Style§hover_style: Style§selected_hover_style: StyleImplementations§
Source§impl MenuBar
impl MenuBar
pub fn new(items: Vec<MenuItem>) -> MenuBar
pub fn with_selected(self, index: usize) -> MenuBar
pub fn normal_style(self, style: Style) -> MenuBar
pub fn selected_style(self, style: Style) -> MenuBar
pub fn hover_style(self, style: Style) -> MenuBar
pub fn selected_hover_style(self, style: Style) -> MenuBar
pub fn update_hover(&mut self, column: u16, row: u16)
pub fn handle_click(&mut self, column: u16, row: u16) -> Option<usize>
pub fn handle_mouse(&mut self, column: u16, row: u16) -> WidgetEvent
pub fn selected(&self) -> Option<usize>
pub fn render(&mut self, frame: &mut Frame<'_>, area: Rect)
pub fn render_with_offset( &mut self, frame: &mut Frame<'_>, area: Rect, left_offset: u16, )
pub fn render_centered(&mut self, frame: &mut Frame<'_>, area: Rect)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MenuBar
impl !RefUnwindSafe for MenuBar
impl Send for MenuBar
impl !Sync for MenuBar
impl Unpin for MenuBar
impl UnsafeUnpin for MenuBar
impl !UnwindSafe for MenuBar
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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