pub struct MenuBar { /* private fields */ }Expand description
A horizontal desktop-style menu bar with click-to-open dropdowns.
See the module-level docs for an example.
Implementations§
Source§impl MenuBar
impl MenuBar
Sourcepub fn new(id_salt: impl Hash) -> Self
pub fn new(id_salt: impl Hash) -> Self
Create a new menu bar keyed by id_salt. The salt scopes per-menu
open state in egui memory and must be stable across frames.
Sourcepub fn brand(self, text: impl Into<WidgetText>) -> Self
pub fn brand(self, text: impl Into<WidgetText>) -> Self
Show a brand label on the left, preceded by a small accent square. Use this for the application name.
Sourcepub fn status(self, text: impl Into<WidgetText>) -> Self
pub fn status(self, text: impl Into<WidgetText>) -> Self
Show a muted status line on the right (e.g. "main · up to date").
Sourcepub fn status_with_dot(self, text: impl Into<WidgetText>, dot: Color32) -> Self
pub fn status_with_dot(self, text: impl Into<WidgetText>, dot: Color32) -> Self
Show a status line preceded by a coloured dot, useful for indicating connection or run state (green for healthy, amber for running, red for failing).
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