Node Toolbar
A BlowNodeToolbar in the node template anchors controls to a node - by default while it is selected - and keeps them the same size on screen at any zoom. The toolbar above the canvas places it: the side, where along that side, the gap, and when it shows.
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Click a node to select it: its toolbar appears. ๐จ gives the node a new colour and ๐ deletes it.
- Scroll to zoom in and out: the node grows and shrinks, the toolbar keeps its size and its distance from the node.
- Pick a Position to move the toolbar to another side of the node.
- Pick an Align: Start and End line the toolbar up with the node's left and right corners (top and bottom on the left and right sides) instead of centring it.
- Drag Offset to widen or close the gap between node and toolbar.
- Set Show to Always to keep every node's toolbar open without selecting it, or Never to hide it even on a selected node.
- Drag on the toolbar: it neither moves the node nor pans the canvas.
How it works
BlowNodeToolbargoes inside the node's template, so its buttons can act on that node. It sits inside the zoomed layer and is counter-scaled by the zoom, which is what keeps it a constant size on screen.Visible(null) shows it only while the node is selected; true or false forces it.Position(Top) is the side of the node it is anchored to, andAlign(BlowToolbarAlign.Center, orStartandEnd) where along that side.Offset(8) is the gap between node and toolbar in screen pixels, the same at any zoom.- A press inside the toolbar does not reach the node or the pane, so its buttons are clicked rather than starting a drag or a pan.
- ๐จ writes the node's
Style; ๐ removes the node and its edges from the two lists.FitViewOptionswith aPaddingof 0.3 leaves room for a toolbar on any side.