Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2018-11-30 14:51:10 +0000
committerXi Yan2018-11-30 17:03:35 +0000
commit59b0f429a75003d153116d1b4753427591e69bad (patch)
tree2f9ee7fdcb765f096a11a80ecdb73e478e582bb7 /bundles
parentdb9131e14b7cb99cd8dee07a6180f52878177708 (diff)
downloadeclipse.platform.swt-59b0f429a75003d153116d1b4753427591e69bad.tar.gz
eclipse.platform.swt-59b0f429a75003d153116d1b4753427591e69bad.tar.xz
eclipse.platform.swt-59b0f429a75003d153116d1b4753427591e69bad.zip
Bug 541720 - [Gtk3] Regression: TableColumn.pack() clears header in 4.9
Previous patch (https://git.eclipse.org/r/#/c/126904/ )fixes table appearing as thin line by always showing the table before getting the preferred size, and hiding it afterwards. This caused a regression that when the second time pack() is called, it always hides the header. This patch fixes this by only hiding the header when it is not suppose to be visible. Change-Id: I7cbe06cb36a7ae7b18a52010361f5c575d88ff0b Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
index 089e231984..af97760002 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
@@ -443,10 +443,13 @@ public void pack () {
checkWidget();
int width = 0;
if (buttonHandle != 0) {
+ boolean hideHeader = !GTK.gtk_widget_get_visible(buttonHandle);
GtkRequisition requisition = new GtkRequisition ();
GTK.gtk_widget_show(buttonHandle);
gtk_widget_get_preferred_size (buttonHandle, requisition);
- GTK.gtk_widget_hide(buttonHandle);
+ if (hideHeader) {
+ GTK.gtk_widget_hide(buttonHandle);
+ }
width = requisition.width;
}
if ((parent.style & SWT.VIRTUAL) != 0) {

Back to the top