Node: Rework adding of ports, sort ports and hide seperator when node has no ports

This reworks the adding of a port to nodes, to avoid assigning multiple nodes
to the same grid cell when a node which was not the last in its column has previously
been removed. Instead, the grid is emptied and repopulated each time.

This also lets us sort the nodes each time by name.

Finally, this hides the seperator if a node has no nodes, as it is unneeded.
This commit is contained in:
Tom A. Wagner
2023-08-28 13:11:13 +02:00
parent 4ed7e1f4be
commit 0cb40f5cab
2 changed files with 52 additions and 25 deletions

View File

@@ -20,7 +20,10 @@
</object>
</child>
<child>
<object class="GtkSeparator"></object>
<object class="GtkSeparator" id="separator">
<!-- The node will show the seperator only once ports are added to it -->
<property name="visible">false</property>
</object>
</child>
<child>
<object class="GtkGrid" id="port_grid">