pub struct PlainPlatformMenuItem {
pub label: String,
pub tooltip: Option<String>,
pub shortcut: Option<MenuSerializableShortcutRef>,
pub on_selected: Option<VoidCallback>,
pub on_selected_intent: Option<IntentRef>,
pub check: MenuItemCheck,
pub icon: Option<IconImage>,
}Expand description
A PlatformMenuItem that is a leaf of a menu hierarchy: Dart’s PlatformMenuItem itself.
Fields§
§label: String§tooltip: Option<String>§shortcut: Option<MenuSerializableShortcutRef>§on_selected: Option<VoidCallback>§on_selected_intent: Option<IntentRef>§check: MenuItemCheck§icon: Option<IconImage>Implementations§
Source§impl PlainPlatformMenuItem
impl PlainPlatformMenuItem
Sourcepub fn new(label: impl Into<String>) -> PlainPlatformMenuItem
pub fn new(label: impl Into<String>) -> PlainPlatformMenuItem
Creates a PlainPlatformMenuItem labelled label, disabled until it has an
on_selected or an on_selected_intent.
pub fn tooltip(self, tooltip: impl Into<String>) -> PlainPlatformMenuItem
pub fn shortcut( self, shortcut: MenuSerializableShortcutRef, ) -> PlainPlatformMenuItem
pub fn on_selected(self, on_selected: VoidCallback) -> PlainPlatformMenuItem
pub fn on_selected_intent(self, intent: IntentRef) -> PlainPlatformMenuItem
pub fn check(self, check: MenuItemCheck) -> PlainPlatformMenuItem
pub fn icon(self, icon: IconImage) -> PlainPlatformMenuItem
Trait Implementations§
Source§impl Debug for PlainPlatformMenuItem
impl Debug for PlainPlatformMenuItem
Source§impl PlatformMenuItem for PlainPlatformMenuItem
impl PlatformMenuItem for PlainPlatformMenuItem
Source§fn tooltip(&self) -> Option<&str>
fn tooltip(&self) -> Option<&str>
The optional tooltip text that is displayed when the user hovers over the menu item.
Source§fn shortcut(&self) -> Option<&MenuSerializableShortcutRef>
fn shortcut(&self) -> Option<&MenuSerializableShortcutRef>
The optional shortcut that selects this
PlatformMenuItem. Read moreSource§fn on_selected(&self) -> Option<&VoidCallback>
fn on_selected(&self) -> Option<&VoidCallback>
An optional callback that is called when this
PlatformMenuItem is selected. Read moreSource§fn on_selected_intent(&self) -> Option<&IntentRef>
fn on_selected_intent(&self) -> Option<&IntentRef>
An optional intent that is invoked when this
PlatformMenuItem is selected. Read moreSource§fn check(&self) -> MenuItemCheck
fn check(&self) -> MenuItemCheck
The check the item shows, and which.
Converts the representation of this item into the entries the host’s menu takes.
Source§fn on_open(&self) -> Option<&VoidCallback>
fn on_open(&self) -> Option<&VoidCallback>
Returns a callback, if any, to be invoked if the platform menu receives a “Menu.opened”
method call from the platform for this item. Read more
Source§fn on_close(&self) -> Option<&VoidCallback>
fn on_close(&self) -> Option<&VoidCallback>
Returns a callback, if any, to be invoked if the platform menu receives a “Menu.closed”
method call from the platform for this item. Read more
Source§fn descendants(&self) -> Vec<PlatformMenuItemRef>
fn descendants(&self) -> Vec<PlatformMenuItemRef>
Returns all descendant
PlatformMenuItems of this item. Read moreSource§fn members(&self) -> Vec<PlatformMenuItemRef>
fn members(&self) -> Vec<PlatformMenuItemRef>
Returns the list of group members if this menu item is a “grouping” menu item, such as
PlatformMenuItemGroup. Read moreSource§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Dart’s
PlatformMenuItem.debugFillProperties, which an implementor’s own body calls
where Dart writes super.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Dart’s
PlatformMenuItem.toStringShort: the identity, then the label in parentheses.Source§fn diagnostics_node(&self, name: Option<String>) -> DiagnosticableNode
fn diagnostics_node(&self, name: Option<String>) -> DiagnosticableNode
Dart’s
PlatformMenuItem.toDiagnosticsNode(name:), from Diagnosticable.Source§fn diagnostic_string(&self) -> String
fn diagnostic_string(&self) -> String
Dart’s
Diagnosticable.toString, which a group’s member list prints.Auto Trait Implementations§
impl !RefUnwindSafe for PlainPlatformMenuItem
impl !Send for PlainPlatformMenuItem
impl !Sync for PlainPlatformMenuItem
impl !UnwindSafe for PlainPlatformMenuItem
impl Forget for PlainPlatformMenuItem
impl Freeze for PlainPlatformMenuItemwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<dyn MenuSerializableShortcut> is !null: Freeze,
PhantomData<RcInner<dyn MenuSerializableShortcut>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
*const RcInner<dyn Intent> is !null: Freeze,
PhantomData<RcInner<dyn Intent>>: Freeze,
*const ArcInner<[u8]> is !null: Freeze,
PhantomData<ArcInner<[u8]>>: Freeze,
impl Move for PlainPlatformMenuItem
impl Unpin for PlainPlatformMenuItem
impl UnsafeUnpin for PlainPlatformMenuItemwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn MenuSerializableShortcut> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn MenuSerializableShortcut>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
*const RcInner<dyn Intent> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Intent>>: UnsafeUnpin,
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
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