zng_app::shortcut

Trait CommandShortcutExt

Source
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) -> BoxedVar<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§

Source

fn shortcut(self) -> CommandMetaVar<Shortcuts>

Gets a read-write variable that is zero-or-more shortcuts that invoke the command.

Source

fn shortcut_filter(self) -> CommandMetaVar<ShortcutFilter>

Gets a read-write variable that sets a filter for when the shortcut is valid.

Source

fn init_shortcut(self, shortcut: impl Into<Shortcuts>) -> Self

Sets the initial shortcuts.

Source

fn init_shortcut_filter(self, filter: impl Into<ShortcutFilter>) -> Self

Sets the initial shortcut filters.

Provided Methods§

Source

fn shortcut_txt(self) -> BoxedVar<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.

Implementors§