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.

Object Safety§

This trait is not object safe.

Implementors§