Docs Party 2024 (#15876)
Co-authored-by: Raunak Raj <nkray21111983@gmail.com> Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com> Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Jason <jason@zed.dev> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Jason Mancuso <7891333+jvmncs@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
c633fa5a10
commit
eb3c4b0e46
100 changed files with 2564 additions and 457 deletions
|
@ -4,7 +4,7 @@ GPUI is designed for keyboard-first interactivity.
|
|||
|
||||
To expose functionality to the mouse, you render a button with a click handler.
|
||||
|
||||
To expose functionality to the keyboard, you bind an *action* in a *key context*.
|
||||
To expose functionality to the keyboard, you bind an _action_ in a _key context_.
|
||||
|
||||
Actions are similar to framework-level events like `MouseDown`, `KeyDown`, etc, but you can define them yourself:
|
||||
|
||||
|
@ -55,7 +55,7 @@ impl Render for Menu {
|
|||
}
|
||||
```
|
||||
|
||||
In order to bind keys to actions, you need to declare a *key context* for part of the element tree by calling `key_context`.
|
||||
In order to bind keys to actions, you need to declare a _key context_ for part of the element tree by calling `key_context`.
|
||||
|
||||
```rust
|
||||
impl Render for Menu {
|
||||
|
@ -97,5 +97,4 @@ If you had opted for the more complex type definition, you'd provide the seriali
|
|||
"shift-down": ["menu::Move", {direction: "down", select: true}]
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue