Skip to content

General GUI improvements.

Hi,

Thank you for creating Helvum! 😄

I've made some GUI improvements that we can discuss if you are interested. And if you like it, I would be glad to have contributed a little.

Visual improvements

Here is how my branch looks like: helvum

Here is what I have changed:

  • Created a Header widget for the node view. It uses the headerbar CSS name to be styled just like a window header bar.
  • Created a Handle widget for the port view (the little circles on the side of the nodes). This makes it easier to differentiate between input and output ports (in particular when the node has only one kind of port).
  • Created a Style type (in graph_view.rs) holding the calculated style of the graph view (grid size, grid color, links color, etc.). It is calculated using the active CSS style and font size.
  • Created the draw_grid and draw_links methods to break down the GraphView::snapshot method.
  • Disable anti-aliasing in draw_grid.

Here are some limitations that we can solve later (I don't want to continue working on this if it does not please you):

  • The size of the port handles is hardcoded. We could instead use the font size/port height.
  • The links are now drawn behind the nodes instead of in front of the nodes.

Other improvements

I've also added an order in which each node view is drawn. This is used to avoid having a node hidden behind another one. When a new node is inserted or grab the focus, it is put on top of every other nodes.

Sorry if everything is mixed up in a single commit, I've been discovering gtk-rs working on this, so my workflow was a bit messy.

Merge request reports