feat(Status): move thread lines to snapshoting #1315
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: #633
This should improve performance a bit too.
Here's how thread lines used to work:
Thread line was a single GtkImage that changed its alignment and margins based on the ROLE (start, middle, end)
I had experimented with different approaches without completely moving away from Tootle's and ended up with one GtkImage for the line above the avatar and one for below. They changed visibility based on ROLE (start = bottom visible, middle = both visible, end = top visible)
Now there were two GtkImages when it should be none. The pos over Tootle's approach was better alignment and easier to maintain than guessing margins.
Using snapshoting, it draws a line based on the ROLE and the avatar's position.
It should be faster and have better alignment as we control how and where it gets drawn.
There are comments describing the maths and thought process but the gist is: