From f29f886836b9c68e3c75f3bc76d420ed3432b3a8 Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Thu, 29 Nov 2012 11:49:00 -0500 Subject: [PATCH] Fix for column width problem in Linux Change-Id: Ib439b88740fd8585fa32a8ebaf263bb41c031817 Reviewed-on: https://git.eclipse.org/r/8933 Tested-by: Hudson CI Reviewed-by: Patrick Tasse IP-Clean: Patrick Tasse --- .../tmf/ui/viewers/events/TmfEventsTable.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java index 46ec27f874..9d852e75d0 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java @@ -1093,8 +1093,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS * @since 1.1 */ protected void applyFilter(ITmfFilter filter) { - stopFilterThread(); - stopSearchThread(); + stopFilterThread(); + stopSearchThread(); fFilterMatchCount = 0; fFilterCheckCount = 0; fCache.applyFilter(filter); @@ -1465,9 +1465,20 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS if (fPackDone) { return; } - for (final TableColumn column : fTable.getColumns()) { + boolean isLinux = System.getProperty("os.name").contains("Linux") ? true : false; //$NON-NLS-1$ //$NON-NLS-2$ + + TableColumn tableColumns[] = fTable.getColumns(); + for (int i = 0; i < tableColumns.length; i++) { + final TableColumn column = tableColumns[i]; final int headerWidth = column.getWidth(); column.pack(); + // Workaround for Linux which doesn't consider the image width of + // search/filter row in TableColumn.pack() after having executed + // TableItem.setImage((Image)null) for other rows than search/filter row. + if (isLinux && (i == 0)) { + column.setWidth(column.getWidth() + SEARCH_IMAGE.getBounds().width); + } + if (column.getWidth() < headerWidth) { column.setWidth(headerWidth); } -- 2.34.1