From 89316ebe72862590ef741b5f91cc3171b0d3b92c Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Wed, 13 May 2015 10:32:13 -0400 Subject: [PATCH] tmf: Fix calculation of available alignment width in TimeGraphCombo Before the fix the vertical scroll bar was not considered when calculating the avalible alignment width. To observe the impact of the incorrect aligment value open just HistogramView and ControlFlowView for a kernel trace without the fix. Then the right margin of the Histogram view is not correct. Change-Id: Ia54e2c3f03fcc22def4706b778518353515c7897 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/47852 Reviewed-by: Hudson CI Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- .../tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java index 3ac8dda27b..220b0e16ca 100644 --- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java +++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java @@ -1213,8 +1213,9 @@ public class TimeGraphCombo extends Composite { * @since 1.0 */ public int getAvailableWidth(int requestedOffset) { + int vBarWidth = ((fTimeGraphViewer.getVerticalBar() != null) && (fTimeGraphViewer.getVerticalBar().isVisible())) ? fTimeGraphViewer.getVerticalBar().getSize().x : 0; int totalWidth = fSashForm.getBounds().width; - return Math.min(totalWidth, Math.max(0, totalWidth - requestedOffset)); + return Math.min(totalWidth, Math.max(0, totalWidth - requestedOffset - vBarWidth)); } /** -- 2.34.1