use gpui::{App, KeyBinding, actions};
pub const KEY_CONTEXT: &str = "NetworkGraph";
actions!(
network_graph,
[
ZoomIn,
ZoomOut,
FitView,
ClearSelection,
SelectLeft,
SelectRight,
SelectUp,
SelectDown,
Activate,
OpenContextMenu,
]
);
pub fn init(cx: &mut App) {
let ctx = Some(KEY_CONTEXT);
cx.bind_keys([
KeyBinding::new("=", ZoomIn, ctx),
KeyBinding::new("+", ZoomIn, ctx),
KeyBinding::new("-", ZoomOut, ctx),
KeyBinding::new("0", FitView, ctx),
KeyBinding::new("escape", ClearSelection, ctx),
KeyBinding::new("left", SelectLeft, ctx),
KeyBinding::new("right", SelectRight, ctx),
KeyBinding::new("up", SelectUp, ctx),
KeyBinding::new("down", SelectDown, ctx),
KeyBinding::new("enter", Activate, ctx),
KeyBinding::new("shift-f10", OpenContextMenu, ctx),
]);
}