pub struct ContextMenuSpec<Msg: Clone + 'static> {
pub anchor: (f32, f32),
pub viewport: (f32, f32),
pub header: Option<String>,
pub items: Vec<ContextMenuItem>,
pub active: usize,
pub on_pick: Arc<dyn Fn(usize) -> Msg + Send + Sync>,
pub on_dismiss: Msg,
pub palette: ContextMenuPalette,
}Expand description
Especificación del menú. Mantiene los 8 campos clásicos para no
romper los call-sites por literal; las capacidades nuevas (submenús,
animación, hover) viajan aparte en ContextMenuExtras vía
context_menu_view_ex.
Fields§
§anchor: (f32, f32)§viewport: (f32, f32)§header: Option<String>§items: Vec<ContextMenuItem>§active: usizeÍndice resaltado por keyboard. usize::MAX = ninguno.
on_pick: Arc<dyn Fn(usize) -> Msg + Send + Sync>Click en un item de nivel raíz (índice).
on_dismiss: MsgMsg al click-fuera (scrim) o Esc.
palette: ContextMenuPaletteAuto Trait Implementations§
impl<Msg> !RefUnwindSafe for ContextMenuSpec<Msg>
impl<Msg> !UnwindSafe for ContextMenuSpec<Msg>
impl<Msg> Freeze for ContextMenuSpec<Msg>
impl<Msg> Send for ContextMenuSpec<Msg>
impl<Msg> Sync for ContextMenuSpec<Msg>
impl<Msg> Unpin for ContextMenuSpec<Msg>
impl<Msg> UnsafeUnpin for ContextMenuSpec<Msg>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.