// Feature in Windows. The tree vertical bar reappears when
// the control is resized so we need to hide it again.
- // Bug in Linux. The tree header height is 0 in constructor,
- // so we need to reset it later when the control is resized.
tree.addControlListener(new ControlAdapter() {
private int depth = 0;
@Override
tree.getVerticalBar().setVisible(false);
depth--;
}
- fTimeGraphViewer.setHeaderHeight(tree.getHeaderHeight());
+ }
+ });
+ // Bug in Linux. The tree header height is 0 in constructor,
+ // so we need to reset it later when the control is painted.
+ // This work around used to be done on control resized but the header
+ // height was not initialized on the initial resize on GTK3.
+ tree.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ int headerHeight = tree.getHeaderHeight();
+ if (headerHeight > 0) {
+ fTimeGraphViewer.setHeaderHeight(headerHeight);
+ tree.removePaintListener(this);
+ }
}
});
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.tracecompass.internal.tmf.ui.Messages;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
* The height to use
*/
public void setHeight(int height) {
- this.fHeight = height;
+ if (fHeight != height) {
+ fHeight = height;
+ getParent().layout(new Control[] { this });
+ }
}
/**