pub trait CommandShortcutExt {
// Required methods
fn shortcut(self) -> CommandMetaVar<Shortcuts>;
fn shortcut_filter(self) -> CommandMetaVar<ShortcutFilter>;
fn init_shortcut(self, shortcut: impl Into<Shortcuts>) -> Self;
fn init_shortcut_filter(self, filter: impl Into<ShortcutFilter>) -> Self;
// Provided method
fn shortcut_txt(self) -> Var<Txt>
where Self: Sized { ... }
}Expand description
Adds the shortcut metadata.
If a command has a shortcut the GestureManager will invoke the command when the shortcut is pressed
the command is enabled, if the command target is a widget it will also be focused. See the GESTURES
service documentation for details on how shortcuts are resolved.
Required Methods§
Sourcefn shortcut(self) -> CommandMetaVar<Shortcuts>
fn shortcut(self) -> CommandMetaVar<Shortcuts>
Gets a read-write variable that is zero-or-more shortcuts that invoke the command.
Sourcefn shortcut_filter(self) -> CommandMetaVar<ShortcutFilter>
fn shortcut_filter(self) -> CommandMetaVar<ShortcutFilter>
Gets a read-write variable that sets a filter for when the shortcut is valid.
Sourcefn init_shortcut(self, shortcut: impl Into<Shortcuts>) -> Self
fn init_shortcut(self, shortcut: impl Into<Shortcuts>) -> Self
Sets the initial shortcuts.
Sourcefn init_shortcut_filter(self, filter: impl Into<ShortcutFilter>) -> Self
fn init_shortcut_filter(self, filter: impl Into<ShortcutFilter>) -> Self
Sets the initial shortcut filters.
Provided Methods§
Sourcefn shortcut_txt(self) -> Var<Txt>where
Self: Sized,
fn shortcut_txt(self) -> Var<Txt>where
Self: Sized,
Gets a read-only variable that is the display text for the first shortcut.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".