pub struct Action {
pub id: Arc<str>,
pub label: Arc<str>,
pub icon: Option<Arc<str>>,
pub shortcut: Option<KeyChord>,
pub enabled: bool,
pub checked: Option<bool>,
}Expand description
A high-level user-invokable command. One Action ties together the
menu item, toolbar button, and keyboard shortcut that all do the
same thing - the model Qt’s QAction and GTK 4’s GAction use.
Lives in ActionRegistry (or a similar resource) per the OS plan
(section 470). Backends translate the action into a menu item, hotkey, or
toolbar button as appropriate.
Fields§
§id: Arc<str>Stable id used to dispatch ActionInvoked { id } and to look the
action up across hot-reloads.
label: Arc<str>Human-visible label.
icon: Option<Arc<str>>Optional icon identifier (asset path or theme name).
shortcut: Option<KeyChord>Optional keyboard shortcut.
enabled: booltrue when the action can be invoked.
checked: Option<bool>Some(true|false) for a check / radio action; None for a
plain action.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more