pub struct DropdownMenu { /* private fields */ }Expand description
Dropdown menu component (shadcn/ui Dropdown Menu)
§Example
use armas_basic::components::DropdownMenu;
let mut menu = DropdownMenu::new("actions").open(true);
menu.show(ctx, anchor, |builder| {
builder.item("Cut");
builder.item("Copy");
builder.item("Paste");
builder.separator();
builder.item("Delete");
});Implementations§
Source§impl DropdownMenu
impl DropdownMenu
Sourcepub const fn position(self, position: PopoverPosition) -> Self
pub const fn position(self, position: PopoverPosition) -> Self
Set the menu position
Sourcepub const fn item_height(self, height: f32) -> Self
pub const fn item_height(self, height: f32) -> Self
Set the height of each menu item row
Sourcepub fn show(
&mut self,
ctx: &Context,
anchor_rect: Rect,
content: impl FnOnce(&mut MenuBuilder),
) -> DropdownMenuResponse
pub fn show( &mut self, ctx: &Context, anchor_rect: Rect, content: impl FnOnce(&mut MenuBuilder), ) -> DropdownMenuResponse
Show the menu anchored to a rect
Trait Implementations§
Source§impl Clone for DropdownMenu
impl Clone for DropdownMenu
Source§fn clone(&self) -> DropdownMenu
fn clone(&self) -> DropdownMenu
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DropdownMenu
impl RefUnwindSafe for DropdownMenu
impl Send for DropdownMenu
impl Sync for DropdownMenu
impl Unpin for DropdownMenu
impl UnsafeUnpin for DropdownMenu
impl UnwindSafe for DropdownMenu
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