Vixen
02b45cc4
csharp
public sealed class NodeSearchPopup

Create-a-node by typing, and by dragging a wire into empty space.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is the feature the UX target is judged by. Doc 11 names Unity's shader graph as best-in-class and names searchable creation from a dragged wire as the reason. A create menu of nested submenus is what a graph editor has instead when nobody built this.

⚠ The field keeps the focus and the rows never take it, the same arrangement CommandPalette has and for the same reason: a popup where Down moved the focus into the list is one where the next letter typed goes nowhere. The arrows move a highlight this class owns.

Filtered by the wire, not merely opened by it. A wire dragged off a texture output offers the node types with a texture input, and the row says which port it would land on — so the gesture is one drag and one Enter rather than a drag, a menu, a guess and a second drag.

Fields and properties (8)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • public int Limit

    How many results are shown.

  • public SearchBox Field

    What is typed into it.

  • public UiElement List

    Where the rows go.

  • public UiElement EmptyPart

    What it says when nothing matched.

  • public IReadOnlyList<NodeSearchResult> Results

    What it is showing, best first.

  • public int Highlighted

    Which result is highlighted, or -1 when there are none.

  • public PortFilter? Filter

    The port a dragged wire is looking for, when the popup was opened by one.

Events (1)

Methods (4)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • public void Show(NodeTypeRegistry library, PortFilter? wire, float x, float y)

    Opens it at a point, over everything.

  • public bool Accept()

    Chooses the highlighted result, as Enter does.

  • public void Highlight(int delta)

    Moves the highlight.

Used by (2)

  • NodeGraphViewVixen.Editor.NodeGraph
  • ViewTestsVixen.Editor.NodeGraph.Tests