gpui: Activate the window example along with the Quit action (#30790)
Make the gpui examples more consistent by activating the window upon startup. Most of the examples have ```rust activate(true) ``` so this one should as well. Make it easier to exit the example with the `cmd-q` KeyBinding Release Notes: - N/A
This commit is contained in:
parent
c7da6283cc
commit
df98d94a24
2 changed files with 10 additions and 2 deletions
|
@ -26,6 +26,7 @@ actions!(
|
|||
Paste,
|
||||
Cut,
|
||||
Copy,
|
||||
Quit,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -741,5 +742,7 @@ fn main() {
|
|||
cx.activate(true);
|
||||
})
|
||||
.unwrap();
|
||||
cx.on_action(|_: &Quit, cx| cx.quit());
|
||||
cx.bind_keys([KeyBinding::new("cmd-q", Quit, None)]);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue