diff options
| author | Xi Yan | 2018-10-16 13:06:48 +0000 |
|---|---|---|
| committer | Xi Yan | 2018-10-16 13:10:23 +0000 |
| commit | f79df31668554851b51759fda6ce0e5cae5135f0 (patch) | |
| tree | 60009348b71836acf4d466381901e38b6f5ba12f | |
| parent | c1ecd9777a09020403cec5357fd7630289800ff7 (diff) | |
| download | eclipse.platform.swt-f79df31668554851b51759fda6ce0e5cae5135f0.tar.gz eclipse.platform.swt-f79df31668554851b51759fda6ce0e5cae5135f0.tar.xz eclipse.platform.swt-f79df31668554851b51759fda6ce0e5cae5135f0.zip | |
Bug 540165 - Combo doesn't render the whole text
Added padding when computing size of Combo text. Tested with child
Eclipse and Snippet26.
Change-Id: I1c59205e458a883d10be1f19ffe69580ef980c32
Signed-off-by: Xi Yan <xixiyan@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index 4f8d2302ae..bc40a2e64a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -459,6 +459,15 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) { return computeNativeSize (handle, wHint, hHint, changed); } +@Override +Point computeNativeSize (long /*int*/ h, int wHint, int hHint, boolean changed) { + int [] xpad = new int[1]; + if (textRenderer != 0) GTK.gtk_cell_renderer_get_padding(textRenderer, xpad, null); + Point nativeSize = super.computeNativeSize(h, wHint, hHint, changed); + nativeSize.x += xpad[0] * 2; + return nativeSize; +} + /** * Copies the selected text. * <p> |
