feat: add a quit action
This commit is contained in:
@@ -7,6 +7,8 @@ use gpui_component::{Theme, ThemeMode, ThemeRegistry, theme};
|
|||||||
use gpui_platform::application;
|
use gpui_platform::application;
|
||||||
use settings::{AppearanceMode, SettingsStore};
|
use settings::{AppearanceMode, SettingsStore};
|
||||||
|
|
||||||
|
actions!(signed, [Quit]);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
@@ -17,6 +19,9 @@ fn main() {
|
|||||||
gpui_component::init(cx);
|
gpui_component::init(cx);
|
||||||
theme::init(cx);
|
theme::init(cx);
|
||||||
|
|
||||||
|
cx.bind_keys([KeyBinding::new("secondary-q", Quit, None)]);
|
||||||
|
cx.on_action(|_: &Quit, cx| cx.quit());
|
||||||
|
|
||||||
// The persisted settings must load before the theme is applied.
|
// The persisted settings must load before the theme is applied.
|
||||||
let store = cx.new(|cx| SettingsStore::new(paths::settings_file(), cx));
|
let store = cx.new(|cx| SettingsStore::new(paths::settings_file(), cx));
|
||||||
SettingsStore::set_global(store.clone(), cx);
|
SettingsStore::set_global(store.clone(), cx);
|
||||||
|
|||||||
Reference in New Issue
Block a user