Close current browser tab
This commit is contained in:
+20
-10
@@ -6,21 +6,31 @@ use gpui::{
|
||||
};
|
||||
use shell::ElyShell;
|
||||
|
||||
actions!(ely_app, [Quit]);
|
||||
actions!(ely_app, [CloseCurrentTab, Quit]);
|
||||
|
||||
fn main() {
|
||||
Application::new().run(|cx: &mut App| {
|
||||
gpui_component::init(cx);
|
||||
cx.on_action(quit);
|
||||
cx.bind_keys([KeyBinding::new("cmd-q", Quit, None)]);
|
||||
cx.set_menus(vec![Menu {
|
||||
name: "ELY Browser".into(),
|
||||
items: vec![
|
||||
MenuItem::os_submenu("Services", SystemMenuType::Services),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Quit ELY Browser", Quit),
|
||||
],
|
||||
}]);
|
||||
cx.bind_keys([
|
||||
KeyBinding::new("cmd-w", CloseCurrentTab, None),
|
||||
KeyBinding::new("ctrl-w", CloseCurrentTab, None),
|
||||
KeyBinding::new("cmd-q", Quit, None),
|
||||
]);
|
||||
cx.set_menus(vec![
|
||||
Menu {
|
||||
name: "ELY Browser".into(),
|
||||
items: vec![
|
||||
MenuItem::os_submenu("Services", SystemMenuType::Services),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Quit ELY Browser", Quit),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
name: "File".into(),
|
||||
items: vec![MenuItem::action("Close Tab", CloseCurrentTab)],
|
||||
},
|
||||
]);
|
||||
|
||||
let bounds = Bounds::centered(None, size(px(1240.0), px(780.0)), cx);
|
||||
let opened = cx.open_window(
|
||||
|
||||
Reference in New Issue
Block a user