pub struct Actions {
pub click: Option<String>,
pub dblclick: Option<String>,
pub menu: Vec<MenuEntry>,
}Expand description
What a pointer does on a node: {click?, dblclick?, menu?}.
Fields§
§click: Option<String>The click action.
dblclick: Option<String>The double-click action.
Context-menu entries: actions, items with icons, keys and checks, separators, headers and submenus.
Implementations§
Source§impl Actions
impl Actions
Sourcepub fn new() -> Self
pub fn new() -> Self
No actions.
Examples found in repository?
examples/ask.rs (line 40)
28fn view() -> View<()> {
29 let sizes = SIZES.iter().map(|(value, label)| choice(value, label));
30 View::new().main([html::form().key("ask").child(
31 ui::card()
32 .key("card")
33 .head("Which size?")
34 .max(Bound::w(Extent::Ch(48.0)))
35 .child(ui::row().key("sizes").gap("lg").children(sizes))
36 .child(
37 ui::button("Create")
38 .key("go")
39 .variant("primary")
40 .actions(Actions::new().click("submit")),
41 ),
42 )])
43}Sourcepub fn click(self, act: impl Into<String>) -> Self
pub fn click(self, act: impl Into<String>) -> Self
Sets the click action.
Examples found in repository?
examples/ask.rs (line 40)
28fn view() -> View<()> {
29 let sizes = SIZES.iter().map(|(value, label)| choice(value, label));
30 View::new().main([html::form().key("ask").child(
31 ui::card()
32 .key("card")
33 .head("Which size?")
34 .max(Bound::w(Extent::Ch(48.0)))
35 .child(ui::row().key("sizes").gap("lg").children(sizes))
36 .child(
37 ui::button("Create")
38 .key("go")
39 .variant("primary")
40 .actions(Actions::new().click("submit")),
41 ),
42 )])
43}Adds a context-menu entry: an action’s name, or a MenuEntry.
Trait Implementations§
impl Eq for Actions
impl StructuralPartialEq for Actions
Auto Trait Implementations§
impl Freeze for Actions
impl RefUnwindSafe for Actions
impl Send for Actions
impl Sync for Actions
impl Unpin for Actions
impl UnsafeUnpin for Actions
impl UnwindSafe for Actions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.