Add a keyboard shortcut (Command + Q on Mac or Control + Q on other OS) to Quit the app directly. Fixes #12422

This commit is contained in:
Andrew Mackenzie 2016-07-14 23:23:58 +01:00
parent f2efc0011a
commit daeddc4c6f

View file

@ -917,6 +917,11 @@ impl WindowMethods for Window {
self.event_queue.borrow_mut().push(WindowEvent::Reload);
}
}
(CMD_OR_CONTROL, Some('q'), _) => {
if let Some(true) = PREFS.get("shell.builtin-key-shortcuts.enabled").as_boolean() {
self.event_queue.borrow_mut().push(WindowEvent::Quit);
}
}
_ => {
self.platform_handle_key(key, mods);