Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-03-10 20:57:27 +0000
committerMarkus Keller2016-03-10 21:01:17 +0000
commit2dab66a2b87bd6aadc5f1bd623db1b5aed609dd4 (patch)
tree520d00f0a82ec40ebeb61259628ebe17a68bd2bb
parent32794db089ad0fe52c5aa02fdea493f02952d274 (diff)
downloadeclipse.platform.swt-2dab66a2b87bd6aadc5f1bd623db1b5aed609dd4.tar.gz
eclipse.platform.swt-2dab66a2b87bd6aadc5f1bd623db1b5aed609dd4.tar.xz
eclipse.platform.swt-2dab66a2b87bd6aadc5f1bd623db1b5aed609dd4.zip
Bug 489385: [GTK3] Tree/Table#computeSize(..) returns too small minimal height
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index be61ba6518..991d93094f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -494,12 +494,12 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH;
/*
- * in GTK 3.8 computeNativeSize returning 0 for height.
- * So if the height is returned as zero calculate the table height
- * based on the number of items in the table
+ * In GTK 3, computeNativeSize(..) sometimes just returns the header
+ * height as height. In that case, calculate the table height based on
+ * the number of items in the table.
*/
- if (OS.GTK3 && size.y == 0 && hHint == SWT.DEFAULT) {
- size.y = getItemCount() * getItemHeight();
+ if (OS.GTK3 && hHint == SWT.DEFAULT && size.y == getHeaderHeight()) {
+ size.y = getItemCount() * getItemHeight() + getHeaderHeight();
}
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 9023e6deb5..c70aa25ce6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -546,12 +546,12 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH;
/*
- * in GTK 3.8 computeNativeSize returning 0 for height.
- * So if the height is returned as zero calculate the tree height
- * based on the number of items in the table
+ * In GTK 3, computeNativeSize(..) sometimes just returns the header
+ * height as height. In that case, calculate the table height based on
+ * the number of items in the table.
*/
- if (OS.GTK3 && size.y == 0 && hHint == SWT.DEFAULT) {
- size.y = getItemCount() * getItemHeight();
+ if (OS.GTK3 && hHint == SWT.DEFAULT && size.y == getHeaderHeight()) {
+ size.y = getItemCount() * getItemHeight() + getHeaderHeight();
}
/*

Back to the top