pub struct PlatformProvidedMenuItem {
pub type_: PlatformProvidedMenuItemType,
pub enabled: bool,
}Expand description
A class for PlatformMenuItems that do not have handlers, but are provided by the
platform.
These are typically standard menu items like “Quit” or “Hide”, or Edit’s commands, which the host sends to the focused view.
Check PlatformProvidedMenuItem::has_menu to see if the platform provides the given type.
Fields§
§type_: PlatformProvidedMenuItemTypeThe type of default menu this is.
enabled: boolTrue if this PlatformProvidedMenuItem should be enabled or not.
Implementations§
Source§impl PlatformProvidedMenuItem
impl PlatformProvidedMenuItem
Sourcepub fn new(type_: PlatformProvidedMenuItemType) -> PlatformProvidedMenuItem
pub fn new(type_: PlatformProvidedMenuItemType) -> PlatformProvidedMenuItem
Creates a PlatformProvidedMenuItem of type_, enabled.
pub fn enabled(self, enabled: bool) -> PlatformProvidedMenuItem
Checks to see if the given default menu type is supported on this platform.
Trait Implementations§
Source§impl Debug for PlatformProvidedMenuItem
impl Debug for PlatformProvidedMenuItem
Source§impl PlatformMenuItem for PlatformProvidedMenuItem
impl PlatformMenuItem for PlatformProvidedMenuItem
Source§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.Converts the representation of this item into the entries the host’s menu takes.
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_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 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.
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 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 Forget for PlatformProvidedMenuItem
impl Freeze for PlatformProvidedMenuItem
impl Move for PlatformProvidedMenuItem
impl RefUnwindSafe for PlatformProvidedMenuItem
impl Send for PlatformProvidedMenuItem
impl Sync for PlatformProvidedMenuItem
impl Unpin for PlatformProvidedMenuItem
impl UnsafeUnpin for PlatformProvidedMenuItem
impl UnwindSafe for PlatformProvidedMenuItem
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