pub struct PopupMenu {
pub items: Vec<MenuEntry>,
pub state: PopupMenuState,
pub style: MenuStyle,
}Fields§
§items: Vec<MenuEntry>§state: PopupMenuState§style: MenuStyleImplementations§
Source§impl PopupMenu
impl PopupMenu
pub fn new(items: Vec<MenuEntry>) -> Self
pub fn open_at(&mut self, pos: Point)
pub fn close(&mut self)
pub fn is_open(&self) -> bool
pub fn take_suppress_mouse_up(&mut self) -> bool
pub fn handle_event( &mut self, event: &Event, viewport: Size, ) -> (EventResult, MenuResponse)
pub fn handle_shortcut( &mut self, key: &Key, modifiers: Modifiers, ) -> MenuResponse
pub fn paint( &self, ctx: &mut dyn DrawCtx, font: Arc<Font>, font_size: f64, viewport: Size, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PopupMenu
impl RefUnwindSafe for PopupMenu
impl Send for PopupMenu
impl Sync for PopupMenu
impl Unpin for PopupMenu
impl UnsafeUnpin for PopupMenu
impl UnwindSafe for PopupMenu
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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