Clip and ellipsize GTK labels#4451
Draft
johnzhou721 wants to merge 2 commits into
Draft
Conversation
Fixes beeware#3780. GTK labels are not clipped to their bounds; there is a native ellipsize option on the widget we should enable to automatically put ellipsis at the end of the text if necessary. Enabling this changes the way we use native functions to rehint, and the rehint code is modified accordingly. We should still clip the widget to bounds, however, because the user may set a very very tiny label that can't even fit a single ellipsis, but still we have to clip the label properly to avoid overflow. A drive-by fix to the example app involves bumping the width for the button box, as the buttons were hinted to >120px wide and was overlapping with the text.
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
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.
Fixes #3780.
GTK labels are not clipped to their bounds; there is a native ellipsize option on the widget we should enable to automatically put ellipsis at the end of the text if necessary. Enabling this changes the way we use native functions to rehint, and the rehint code is modified accordingly.
We should still clip the widget to bounds, however, because the user may set a very very tiny label that can't even fit a single ellipsis, but still we have to clip the label properly to avoid overflow.
A drive-by fix to the example app involves bumping the width for the button box, as the buttons were hinted to >120px wide and was overlapping with the text.
PR Checklist: