Register menu2 actions using actions macro
This commit is contained in:
parent
c67f78c065
commit
d25f48ed6b
3 changed files with 14 additions and 27 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -4987,8 +4987,8 @@ dependencies = [
|
|||
name = "menu2"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"gpui2",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -9,5 +9,5 @@ path = "src/menu2.rs"
|
|||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
serde_derive.workspace = true
|
||||
gpui = { package = "gpui2", path = "../gpui2" }
|
||||
serde = { workspace = true }
|
||||
|
|
|
@ -1,25 +1,12 @@
|
|||
use serde_derive::Deserialize;
|
||||
use gpui::actions;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct Cancel;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct Confirm;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct SecondaryConfirm;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct SelectPrev;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct SelectNext;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct SelectFirst;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct SelectLast;
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
pub struct ShowContextMenu;
|
||||
actions!(
|
||||
Cancel,
|
||||
Confirm,
|
||||
SecondaryConfirm,
|
||||
SelectPrev,
|
||||
SelectNext,
|
||||
SelectFirst,
|
||||
SelectLast,
|
||||
ShowContextMenu
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue