diff options
| author | Eric Williams | 2016-02-16 20:39:01 +0000 |
|---|---|---|
| committer | Eric Williams | 2016-02-25 19:06:06 +0000 |
| commit | 4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102 (patch) | |
| tree | 0eb8982dff194f9e36c8b65b4369599db703a2af | |
| parent | 46e387352f469e26ecedddc10ffec2cd16f11d82 (diff) | |
| download | eclipse.platform.swt-4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102.tar.gz eclipse.platform.swt-4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102.tar.xz eclipse.platform.swt-4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102.zip | |
Bug 487522: [GTK3.20] Entries/Text widgets have smaller heights
For GTK3.19 (and more importantly, 3.20) gtk_style_context_get_padding()
no longer returns correct values for GtkEntry widgets. GtkEntry widgets
in general no longer use padding and need to be sized using
width-for-height size management.
The solution here is to call computeNativeSize() on GTK3.19+ to
determine what the height of the entry should be. We can pass in the
width of the widget to computeNativeSize() which will give us the
preferred height based on the given width. This restores entries like
Quick Access, Search, etc. to their GTK3.18- sizes.
Tested on GTK3.19.6, 3.18, 3.16, 3.14, and 2.24. AllNonBrowser JUnit
tests pass on GTK3 and GTK2.
Change-Id: I076cadd66fa45d2dc14ceb78d624503999ca806f
Signed-off-by: Eric Williams <ericwill@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index 3e8ed4a87e..f67ed6f3fd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -600,7 +600,12 @@ public Rectangle computeTrim (int x, int y, int width, int height) { trim.x -= tmp.left; trim.y -= tmp.top; trim.width += tmp.left + tmp.right; - trim.height += tmp.top + tmp.bottom; + if (OS.GTK_VERSION >= OS.VERSION (3, 19, 0)) { + Point widthNative = computeNativeSize(handle, trim.width, SWT.DEFAULT, true); + trim.height = widthNative.y; + } else { + trim.height = tmp.bottom + tmp.top; + } if ((style & SWT.BORDER) != 0) { OS.gtk_style_context_get_border (context, styleState, tmp); trim.x -= tmp.left; |
