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,
}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
Available on crate feature
menu-bar only.pub fn with_selected(self, index: usize) -> MenuBar
Available on crate feature
menu-bar only.pub fn normal_style(self, style: Style) -> MenuBar
Available on crate feature
menu-bar only.pub fn selected_style(self, style: Style) -> MenuBar
Available on crate feature
menu-bar only.pub fn hover_style(self, style: Style) -> MenuBar
Available on crate feature
menu-bar only.pub fn selected_hover_style(self, style: Style) -> MenuBar
Available on crate feature
menu-bar only.pub fn update_hover(&mut self, column: u16, row: u16)
Available on crate feature
menu-bar only.pub fn handle_click(&mut self, column: u16, row: u16) -> Option<usize>
Available on crate feature
menu-bar only.pub fn handle_mouse(&mut self, column: u16, row: u16) -> WidgetEvent
Available on crate feature
menu-bar only.pub fn selected(&self) -> Option<usize>
Available on crate feature
menu-bar only.pub fn render(&mut self, frame: &mut Frame<'_>, area: Rect)
Available on crate feature
menu-bar only.pub fn render_with_offset( &mut self, frame: &mut Frame<'_>, area: Rect, left_offset: u16, )
Available on crate feature
menu-bar only.pub fn render_centered(&mut self, frame: &mut Frame<'_>, area: Rect)
Available on crate feature
menu-bar only.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