Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nit: reduce GtkColumnListView spacing so tree branches visually connect #206

Open
schnommus opened this issue Oct 28, 2024 · 4 comments
Open

Comments

@schnommus
Copy link

This is a very minor look-and-feel thing. Looking for opinions, happy to help out (e.g. PR) if you think it would be useful.

A normal packetry session might look like this:
Screenshot_select-area_20241028221444

By switching to a bitmap monospace font (Terminus here) and reducing the vertical padding, the tree connections between rows meet up:
Screenshot_select-area_20241028221329

There are still some horizontal tree misalignments above (which would need to be fixed). It would also make sense to only reduce padding in the central ListView and not everywhere in the whole application of course (this is happening as I'm applying the style to every element using the GTK debugger, however is just for the sake of example)

Does this sound like a reasonable change or are there some plan to move to different connector icons? (i.e graphical, non-ASCII)

@martinling
Copy link
Member

Hi @schnommus,

Yes, it would be nice if we could get those to join up nicely.

In the longer term, I'd been thinking we'd substitute each of those text characters with graphical elements, so that we have more control over their appearance. But the rendering is always going to have to work on a per-row basis, so we'll need to eliminate the padding between rows either way.

The easiest way to do it is probably to eliminate all the vertical padding which gets between each rows' label containing the connecting lines, and then increase the font size of that label such that it ends up defining the overall height of the row, whilst leaving the rest of the content at the same size and spacing as it is now.

Even if we eventually implement a graphical version, I'd want to keep the text version behind the scenes. It's good for outputting the UI contents to a file for test purposes, and we might want a TUI frontend at some point in the future too.

@martinling
Copy link
Member

By the way - I notice you moved the expander widgets to the left of the connecting lines too.

We used to have it that way, but we changed it to keep the expanders on the right, because in a complex capture the connections can get quite complicated, which would put the expanders a long way from the things they act on:

image

@schnommus
Copy link
Author

Hi @martinling,

Indeed as you suggested increasing the font size only in the connector cell makes this easier to achieve. Unfortunately I was not able to get the padding to exactly zero by modifying the various component properties, and had to apply a CSS rule to the label instead with a negative margin to get truly 'no' padding.

Now it's much closer to what I was imagining (also padded down the expanders so they are vertically centered):

image

Patch to get the above result is here (requires Terminus already installed): main...schnommus:packetry:seb/css-terminus

This is enough to make my eyes happy, but probably a fair bit more work would be needed to have the padding/sizing work correctly across all possible font/DPI settings.

Another thing I was experimenting with was replacing the with an , so the expander dropdowns smoothly open:

image

Doing this properly would require the connector to know whether an expander is open or closed (to choose a circle or an arc), but visually it feels a bit less cluttered. All a matter of opinion, just sharing some notes in case they are useful 😄

@schnommus schnommus changed the title nit: reduce ListItem spacing so tree branches visually connect nit: reduce GtkColumnListView spacing so tree branches visually connect Oct 29, 2024
@martinling
Copy link
Member

Making the connectors vary with the expanded status is fairly straightforward.

Personally I do like the curved corners - I think I had a version which used them at some point. But if you're going to curve the top corners, please curve the bottom ones too! 😁

See this commit on top of your branch: martinling@04aefe4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants