Workaround for unexpected text wrapping in ExpandableComposite #2986
+8
−1
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.
This PR adds one additional point to the width when calculating the minimum size of the textLabel in ExpandableComposite. This serves as a workaround for a current limitation in the SWT implementation on Windows. With certain zoom settings (e.g., 125% or 175%), depending on the length of the label text, the calculated width may be too small, causing the text to wrap unnecessarily.
This is intended as a temporary workaround. If we merge this, we should either revert it after the release to reintroduce the issue or have hopefully a proper fix inside of SWT.
I want to emphasize this PR is only a workaround not my preferred one, but the only one, I see feasible as of now. We could still come to the conclusion to not merge/close this PR if the effect is acceptable for now until this issue can be solved inside of SWT.
How to test
You can see this effect e.g. in the Manifest Editor as well. You should see the issue in 175% in the Build tab and the Runtime Information section.
Screenshot before
Screenshot after