pub struct Command2<F: Fn()> { /* private fields */ }
Implementations§
Source§impl<F> Command2<F>where
F: Fn(),
impl<F> Command2<F>where
F: Fn(),
Sourcepub fn hotkey(self, key: HotKey) -> Self
pub fn hotkey(self, key: HotKey) -> Self
Adds a hotkey to the menu command.
Examples found in repository?
examples/menu.rs (line 22)
6fn main() {
7 rui(hstack((
8 circle()
9 .color(RED_HIGHLIGHT)
10 .padding(Auto)
11 .command("File:New", Some(HotKey::KeyN), |_| println!("new")),
12 rectangle()
13 .corner_radius(5.0)
14 .color(AZURE_HIGHLIGHT)
15 .padding(Auto)
16 .command("Edit:Two", None, |_| println!("two"))
17 .command("Edit:Three", None, |_| println!("three"))
18 .command("Custom:Submenu:One", None, |_| println!("submenu one"))
19 .command("Custom:Submenu:Two", None, |_| println!("submenu two"))
20 .command_group((command("Custom 2:Four")
21 .action(|| println!("four"))
22 .hotkey(HotKey::KeyF),)),
23 )));
24}
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Command2<F>where
F: Freeze,
impl<F> RefUnwindSafe for Command2<F>where
F: RefUnwindSafe,
impl<F> Send for Command2<F>where
F: Send,
impl<F> Sync for Command2<F>where
F: Sync,
impl<F> Unpin for Command2<F>where
F: Unpin,
impl<F> UnwindSafe for Command2<F>where
F: UnwindSafe,
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