Skip to content

Commit 1cdde6d

Browse files
committed
Workaround for unexpected text wrapping
This commit 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. Contributes to #2980
1 parent 208faf9 commit 1cdde6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ protected void layout(Composite parent, boolean changed) {
287287
Point labelDefault = this.textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT);
288288

289289
int tcWidthBeforeSplit = Math.min(width, tcDefault.x);
290-
int labelWidthBeforeSplit = Math.min(width, labelDefault.x);
290+
int labelWidthBeforeSplit = Math.min(width, labelDefault.x + 1 /* compensate rounding issue in windows */);
291291

292292
int tcWidthAfterSplit = tcWidthBeforeSplit;
293293
int labelWidthAfterSplit = labelWidthBeforeSplit;

0 commit comments

Comments
 (0)