pub trait CommandShortcutExt {
// Required methods
fn shortcut(self) -> Box<dyn VarBoxed<Shortcuts>>;
fn shortcut_filter(self) -> Box<dyn VarBoxed<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) -> Box<dyn VarBoxed<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) -> Box<dyn VarBoxed<Shortcuts>>
fn shortcut(self) -> Box<dyn VarBoxed<Shortcuts>>
Gets a read-write variable that is zero-or-more shortcuts that invoke the command.
Sourcefn shortcut_filter(self) -> Box<dyn VarBoxed<ShortcutFilter>>
fn shortcut_filter(self) -> Box<dyn VarBoxed<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) -> Box<dyn VarBoxed<Txt>>where
Self: Sized,
fn shortcut_txt(self) -> Box<dyn VarBoxed<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", so this trait is not object safe.