Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2013-11-13 16:44:12 -0500
committerPatrick Tasse2013-11-27 13:35:59 -0500
commitf9fd6019e655b531a16e8d5fd117a1ff2009687c (patch)
treec4aa4045807665687dfd39d5057194d2516df7bf
parent91bd18975bdaf210ac3935233484a26383dd764e (diff)
downloadorg.eclipse.linuxtools-f9fd6019e655b531a16e8d5fd117a1ff2009687c.tar.gz
org.eclipse.linuxtools-f9fd6019e655b531a16e8d5fd117a1ff2009687c.tar.xz
org.eclipse.linuxtools-f9fd6019e655b531a16e8d5fd117a1ff2009687c.zip
tmf: Update histogram layout
- Both histograms fill all available space with no minimum height - The max nb event text control grows in width according to its maximum (watermark) text extent but never shrinks, eliminating layout jitter (bug 375990) Change-Id: I1ca835434f3e0fca4196aa7f23eb29dead2f50db Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/18355 Tested-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java6
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java2
2 files changed, 8 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java
index 341d7052ca..8eb5d157db 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java
@@ -263,6 +263,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
composite.setLayoutData(gridData);
// Y-axis max event
@@ -283,7 +284,10 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
gridData.verticalSpan = 2;
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
+ gridData.heightHint = 0;
+ gridData.widthHint = 0;
gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
canvasComposite.setLayoutData(gridData);
canvasComposite.setLayout(new FillLayout());
fCanvas = new Canvas(canvasComposite, SWT.DOUBLE_BUFFERED);
@@ -577,6 +581,8 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
long maxNbEvents = HistogramScaledData.hideLostEvents ? fScaledData.fMaxValue : fScaledData.fMaxCombinedValue;
fMaxNbEventsText.setText(Long.toString(maxNbEvents));
// The Y-axis area might need to be re-sized
+ GridData gd = (GridData) fMaxNbEventsText.getLayoutData();
+ gd.widthHint = Math.max(gd.widthHint, fMaxNbEventsText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x);
fMaxNbEventsText.getParent().layout();
}
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
index 4035b12c12..89fd32aad3 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java
@@ -224,6 +224,7 @@ public class HistogramView extends TmfView {
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
timeRangeComposite.setLayoutData(gridData);
// Histogram
@@ -251,6 +252,7 @@ public class HistogramView extends TmfView {
gridData.verticalAlignment = SWT.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = true;
fullRangeComposite.setLayoutData(gridData);
// Histogram

Back to the top