This sets a maximum width of 20 chars on labels on nodes and ports.
Longer labels will wrap to a second line.
For labels longer than two lines, the label is ellipsized at the end.
The full label can still be viewed via hovering for a tooltip.
Co-authored-by: Roger Roger <me@rogerrogert.de>
Revamp the node dragging implementation, moving it into the GraphView
widget.
When a drag is initiated, the node widget's current position is stored.
Whenever the drag gesture is updated, the node widget's position is set
by adding the relative drag vector to the position at the start of the
drag.
A drag gesture on the node widget rather than the GraphView widget was
considered, but this seems to lead to a weird flickering effect when the
node is moved while the drag gesture on the node is active.
To avoid interfering with the drag handlers on the ports, check if the
GraphView drag gesture targets a port, in which case the handler does
nothing.
The pipewire loop now runs without interruption in a second thread and communicates with
the GTK thread via a channel in each direction, instead of checking for events once a second and using callbacks.
This allows changes to appear instantly in the view, instead of having to wait.