-
Notifications
You must be signed in to change notification settings - Fork 29
Add Baseline Vertical Alignment #227
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refs #88 This set of changes starts working towards supporting baseline alignment. The Grid widget currently does not honor vertical align in any way, but it in theory propagates the first row's baseline information -- which will need to be adjusted if Baseline vertical alignment is used. Next step is to actually add Baseline and try to make it work. The set of changes thus far was just so massive and I finally resolved all the errors from this refactoring.
Also fixed indicator baseline calculations.
The thread sender was limited to 256 pending change callbacks in queue. A change callback went to enqueue when the channel was full, the executor thread would deadlock. Now, the executor thread uses its own queue for enqueuing change callbacks, ensuring that it cannot be blocked due to too much inbound traffic.
The containers example has slowed down at some point. Some very basic benchmarking pointed to the font family list being applied being expensive. I attempted to reduce the overhead of this by making single element lists be allocation free. Unfortunately that wasn't enough, and this slowdown is almost certainly unrelated to this branch, so while I'm keeping the optimization, the example is still too slow. In the process of trying to get baseline working for the Grid widget, at one point I changed the "other" constraint to SizeToFit to prevent labels from growing. Ultimately, the label code itself was updated to account for this. By changing this back, many examples were working correctly again. Lastly, the selection rectangle for a single line of text wasn't including the descender... which then became more complex since that measurement isn't present if the text doesn't have any descenders. There's an approximation in place now, but I suspect we should measure a character with a descender to get the line metrics.
This was referenced Mar 23, 2025
This feels hacky, but I'm not sure of a better way to get consistent measurements.
When not aligning, the child widget should be forced to fill if the constraint limit is fill.
While updating the changelog I noticed that size now returned a layout, and it seemed more appropriate to rename the function even though it's a larger breaking change
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #88
Inputwidget has a different baseline than when any text is present