Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2016-02-16 20:39:01 +0000
committerEric Williams2016-02-25 19:36:31 +0000
commit991352091018ac80965024c1500104d29f23e7f8 (patch)
tree369b71a723b453b6df7c5ee513f8777267c5831a
parent8a370a563c18a63d7de19922c28261623b74f8b3 (diff)
downloadeclipse.platform.swt-991352091018ac80965024c1500104d29f23e7f8.tar.gz
eclipse.platform.swt-991352091018ac80965024c1500104d29f23e7f8.tar.xz
eclipse.platform.swt-991352091018ac80965024c1500104d29f23e7f8.zip
Bug 487522: [GTK3.20] Entries/Text widgets have smaller heights
NOTE: This is an updated commit that fixes a small typo. 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: I5c2192c2795b3ddedf3f4937086a3bddf34f7a9c Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java7
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..bfe70ad100 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.top + tmp.bottom;
+ }
if ((style & SWT.BORDER) != 0) {
OS.gtk_style_context_get_border (context, styleState, tmp);
trim.x -= tmp.left;

Back to the top