Introduce keyboard navigation in context menus
This commit is contained in:
parent
991eb742b0
commit
5b2d6e41f3
20 changed files with 121 additions and 34 deletions
11
crates/menu/Cargo.toml
Normal file
11
crates/menu/Cargo.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "menu"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
path = "src/menu.rs"
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
gpui = { path = "../gpui" }
|
16
crates/menu/src/menu.rs
Normal file
16
crates/menu/src/menu.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
#[derive(Clone)]
|
||||
pub struct SelectIndex(pub usize);
|
||||
|
||||
gpui::actions!(
|
||||
menu,
|
||||
[
|
||||
Cancel,
|
||||
Confirm,
|
||||
SelectPrev,
|
||||
SelectNext,
|
||||
SelectFirst,
|
||||
SelectLast
|
||||
]
|
||||
);
|
||||
|
||||
gpui::impl_internal_actions!(menu, [SelectIndex]);
|
Loading…
Add table
Add a link
Reference in a new issue