Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2018-07-22 14:27:50 -0400
committerThomas Wolf2018-07-22 14:27:50 -0400
commit5e5aa48aa2a46b9eefbf7029c54b1035465825d4 (patch)
tree5f3cb85aba89d744721b4d5e1ecbbee25bb5b1ab /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal
parentabed6d01814ace23f3c0cc7f2c047105257056ae (diff)
downloadegit-5e5aa48aa2a46b9eefbf7029c54b1035465825d4.tar.gz
egit-5e5aa48aa2a46b9eefbf7029c54b1035465825d4.tar.xz
egit-5e5aa48aa2a46b9eefbf7029c54b1035465825d4.zip
Fix wrapping label in DateFormatPreferencePage
Using SWT.FILL and SWT.TOP as _width and height_ makes no sense. The real problem with wrapping labels in a GridLayout is that one needs some width to wrap against. With SWT.DEFAULT, the layout lets the label itself determine its width, which of course will always be the unwrapped width absent any other constraints. If one wants to have wrapping, one needs to provide a reasonable widthHint. Change-Id: Ie07d2fd93f110048ddcfb535d0706347915852d0 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DateFormatPreferencePage.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DateFormatPreferencePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DateFormatPreferencePage.java
index 1c08af62e..290318f6c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DateFormatPreferencePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/DateFormatPreferencePage.java
@@ -147,8 +147,9 @@ public class DateFormatPreferencePage extends FieldEditorPreferencePage
dummyLabel.setLayoutData(SWTUtils.createGridData(SWT.DEFAULT,
SWT.DEFAULT, false, false));
formatExplanation = new Label(pane, SWT.LEFT | SWT.WRAP);
- GridData layout = SWTUtils.createGridData(SWT.FILL, SWT.TOP,
+ GridData layout = SWTUtils.createGridData(SWT.DEFAULT, SWT.DEFAULT,
true, false);
+ layout.widthHint = 150; // For wrapping
formatExplanation.setLayoutData(layout);
// Setup based on initial values. We don't get any events by the editors
// on initial load!

Back to the top