Forces the direction on the nodes internal port grid and on the ports themselves
to be always left-to-right (LTR), to avoid the UI becoming messed up when defaulting
to right-to-left (RTL).
Previously, when using RTL, the side of input and output ports would be swapped,
causing the port handles to be inside the node instead of at the edge.
This will make the session manager give Helvum full permissions even when
used from flatpak or otherwise restricted, so that we can always change
the graph even if permissions become more restricted in the future.
The change to AdwToolbarView put the disconnected banner into the toolbar, resulting in a weird-looking
separator when the bar is shown.
This moves the banner into the "content" widget of the AdwToolbarView to fix that issue.
Removes the .toolbar class from a box in the headerbar and instead sets spacing property.
The .toolbar class added extra vertical padding, so the headerbar had to increase its size
This adds a new adw::AboutWindow containing information about version, authors, license, links etc.
It is opened via a new menu button in the toolbar, which opens a menu containing an "About Helvum" button.
The version and authors are pulled from the Cargo.toml file.
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.
Nodes now have a background using the libadwaita .card style class.
Ports now have a circular handle, which is positioned on the edge of the node so that half of the circle sticks out.
Ports are also no longer themed like a button and don't receive a color based on the guessed media type, in a future commit,
the handle will be colored instead.
This ports the application to libadwaita, enabling us to use the libadwaita stylesheet and
widgets to better implement the Gnome Human Interface Guidelines.
Format params for links and ports are now being watched for in the pipewire connection code.
The parsed media type is then set on the port widget / link object
and they are colored accordingly.
For ports, which were already colored before, this new method of determining the media type
should be more reliable and accurate as this uses the real Format/EnumFormat
params instead of parsing optional properties.
Cursor movement during port drag-and-drop on the graph is now being tracked
and a link is drawn from the dragged port to the cursor.
If the cursor is hovering a port the source port can link to,
the second end of the link instead attaches to the ports link anchor
so that the link "snaps" to the linkable port.
Instead of different types for each direction to avoid linking ports
of the same direction, we reject the drop early if directions of both
ports are the same.
The direction check is easily extendable to also deny links between
ports of different media types in the future.
The graph widgets management (watching a glib receiver, adding and removing
Nodes, Ports and Links) currently done in the `Application` and `GraphView`
objects has been extracted into a new GraphManager object, which watches the
receiver instead, pushes changes directly to the widgets, and reacts to their signals.
This seperates widget logic and management logic cleanly instead of both
being mixed into the GraphView, and also reduces the code size for the
Application object.
Previously, the allocated height and width to a node on the graph was divided by the zoom factor,
to account for the changed size from them being zoomed.
To zoom each node, we `size_allocate` it with a GskTransform that scales it.
However, using a scaling transform to allocate the node already takes care of scaling the height and
width, so us also scaling the height and width manually means we were overcompensating.
This resulted in the allocation becoming to big when zooming out, and to small when zooming in.
This is observable as labels will become smaller when zooming in and ellipsize their content.
The commit removes the extra manual scaling so nodes get allocated properly when zoomed.