pub struct Action<M> { /* private fields */ }Expand description
Something the widget can do, from Widget::actions, for the dormer:
the host’s search dialog. Typing finds it by its title, subtitle and keywords, and picking it
sends message to the widget.
Implementations§
Source§impl<M> Action<M>
impl<M> Action<M>
Sourcepub fn id(self, id: impl Into<String>) -> Self
pub fn id(self, id: impl Into<String>) -> Self
Its name, for eave action <widget> <id> and for keys in config.toml. Give one to every
action that’s always there, like mute; leave it out on ones that come and go, like a
window to switch to.
Sourcepub fn shortcut(self, key: Shortcut) -> Self
pub fn shortcut(self, key: Shortcut) -> Self
A key that runs it while the dormer is open, shown at its row’s end. It needs Ctrl, Alt or
Super, since the dormer’s field has the keys that type, and an id, which
the user can give it another key by. When two widgets’ actions want the same key, the
widget earlier in config.toml keeps it.
Sourcepub fn subtitle(self, text: impl Into<String>) -> Self
pub fn subtitle(self, text: impl Into<String>) -> Self
A line under the title: what it acts on, or what kind of thing it is.
Sourcepub fn keywords(
self,
words: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn keywords( self, words: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Other words it should be found by, not shown.