1use gpui::{App, KeyBinding, actions};
2
3pub const KEY_CONTEXT: &str = "NetworkGraph";
5
6actions!(
7 network_graph,
8 [
9 ZoomIn,
11 ZoomOut,
13 FitView,
15 ClearSelection,
17 SelectLeft,
19 SelectRight,
20 SelectUp,
21 SelectDown,
22 Activate,
24 OpenContextMenu,
26 ]
27);
28
29pub fn init(cx: &mut App) {
31 let ctx = Some(KEY_CONTEXT);
32 cx.bind_keys([
33 KeyBinding::new("=", ZoomIn, ctx),
34 KeyBinding::new("+", ZoomIn, ctx),
35 KeyBinding::new("-", ZoomOut, ctx),
36 KeyBinding::new("0", FitView, ctx),
37 KeyBinding::new("escape", ClearSelection, ctx),
38 KeyBinding::new("left", SelectLeft, ctx),
39 KeyBinding::new("right", SelectRight, ctx),
40 KeyBinding::new("up", SelectUp, ctx),
41 KeyBinding::new("down", SelectDown, ctx),
42 KeyBinding::new("enter", Activate, ctx),
43 KeyBinding::new("shift-f10", OpenContextMenu, ctx),
44 ]);
45}