pub struct MenuSection { /* private fields */ }Expand description
A small uppercase header used to label a group of items inside a
Menu popup, ContextMenu, or
MenuBar dropdown.
Add with ui.add(MenuSection::new("Edit")) between groups of related
items. The header is non-interactive and renders in the muted text
tone with extra top padding so it visually separates from the item
above without needing a separator.
Menu::new("row_actions").show_below(&trigger, |ui| {
ui.add(MenuItem::new("Copy").shortcut("\u{2318}C"));
ui.separator();
ui.add(MenuSection::new("Selection"));
ui.add(MenuItem::new("Highlight matches").checked(true));
ui.add(MenuItem::new("Show whitespace").checked(false));
});Implementations§
Source§impl MenuSection
impl MenuSection
Sourcepub fn new(label: impl Into<WidgetText>) -> Self
pub fn new(label: impl Into<WidgetText>) -> Self
Create a section header with the given label. The text is uppercased at render time.
Trait Implementations§
Source§impl Debug for MenuSection
impl Debug for MenuSection
Auto Trait Implementations§
impl Freeze for MenuSection
impl RefUnwindSafe for MenuSection
impl Send for MenuSection
impl Sync for MenuSection
impl Unpin for MenuSection
impl UnsafeUnpin for MenuSection
impl UnwindSafe for MenuSection
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