pub struct Action {
pub value: String,
pub label: String,
pub title: Option<String>,
pub group: Option<String>,
pub enabled: bool,
pub active: bool,
pub icon: Option<&'static str>,
}Expand description
Something to do or to choose, as an Control::Actions offers it.
Fields§
§value: StringWhat pressing it sends back, as super::Value::Choice.
label: String§title: Option<String>What it does — or, disabled, why it cannot be done now.
group: Option<String>Actions of one group are shown together under its name.
enabled: bool§active: boolShown pressed: the tool in hand, the way chosen.
icon: Option<&'static str>The icon it is shown as, with its label as its tooltip — SVG on a
20 × 20 grid, drawn in the current colour (see
crate::editable::OperationInfo::icon); none to show the label.
Implementations§
Source§impl Action
impl Action
pub fn new(value: impl Into<String>, label: impl Into<String>) -> Self
Sourcepub fn icon(self, icon: impl Into<Option<&'static str>>) -> Self
pub fn icon(self, icon: impl Into<Option<&'static str>>) -> Self
Shown as icon, if one is given (see Action::icon).
pub fn title(self, title: impl Into<String>) -> Self
pub fn group(self, group: impl Into<String>) -> Self
pub fn active(self, active: bool) -> Self
Trait Implementations§
impl StructuralPartialEq for Action
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