|
@@ -182,6 +182,12 @@ internal class NodeGraphView : Zoombox.Zoombox
|
|
set { SetValue(ActiveFrameProperty, value); }
|
|
set { SetValue(ActiveFrameProperty, value); }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public bool IsMenuOpen
|
|
|
|
+ {
|
|
|
|
+ get { return (bool)GetValue(IsMenuOpenProperty); }
|
|
|
|
+ set { SetValue(IsMenuOpenProperty, value); }
|
|
|
|
+ }
|
|
|
|
+
|
|
private bool isDraggingNodes;
|
|
private bool isDraggingNodes;
|
|
private bool isDraggingConnection;
|
|
private bool isDraggingConnection;
|
|
private VecD clickPointOffset;
|
|
private VecD clickPointOffset;
|
|
@@ -208,6 +214,7 @@ internal class NodeGraphView : Zoombox.Zoombox
|
|
private List<Control> nodeViewsCache = new();
|
|
private List<Control> nodeViewsCache = new();
|
|
|
|
|
|
private bool isSelecting;
|
|
private bool isSelecting;
|
|
|
|
+ public static readonly StyledProperty<bool> IsMenuOpenProperty = AvaloniaProperty.Register<NodeGraphView, bool>("IsMenuOpen");
|
|
|
|
|
|
public static readonly StyledProperty<int> ActiveFrameProperty =
|
|
public static readonly StyledProperty<int> ActiveFrameProperty =
|
|
AvaloniaProperty.Register<NodeGraphView, int>("ActiveFrame");
|
|
AvaloniaProperty.Register<NodeGraphView, int>("ActiveFrame");
|
|
@@ -255,6 +262,15 @@ internal class NodeGraphView : Zoombox.Zoombox
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected override void OnKeyDown(KeyEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ base.OnKeyDown(e);
|
|
|
|
+ if (e.Key == Key.Space)
|
|
|
|
+ {
|
|
|
|
+ IsMenuOpen = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private void NodeItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
|
private void NodeItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
|
{
|
|
{
|
|
if (e.Action == NotifyCollectionChangedAction.Add)
|
|
if (e.Action == NotifyCollectionChangedAction.Add)
|