From 0a3b20f5f99bec75b590aa81ae26aac046efd794 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Thu, 8 Aug 2013 13:28:08 +0200 Subject: QmlProfiler: reworked Change-Id: I66a236a024d76e7bef6edfb91ae30b5dd098b76b Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/qml/TimeMarks.qml | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/plugins/qmlprofiler/qml/TimeMarks.qml') diff --git a/src/plugins/qmlprofiler/qml/TimeMarks.qml b/src/plugins/qmlprofiler/qml/TimeMarks.qml index bb0c07e400..f2ba65f66e 100644 --- a/src/plugins/qmlprofiler/qml/TimeMarks.qml +++ b/src/plugins/qmlprofiler/qml/TimeMarks.qml @@ -48,6 +48,11 @@ Canvas2D { requestRedraw(); } + Connections { + target: labels + onHeightChanged: { requestRedraw(); } + } + onDrawRegion: { drawBackgroundBars( ctxt, region ); @@ -86,19 +91,21 @@ Canvas2D { } } + // gray off out-of-bounds areas var rectWidth; - if (startTime < qmlProfilerDataModel.traceStartTime()) { + if (startTime < qmlProfilerModelProxy.traceStartTime()) { ctxt.fillStyle = "rgba(127,127,127,0.2)"; - rectWidth = (qmlProfilerDataModel.traceStartTime() - startTime) * spacing; + rectWidth = (qmlProfilerModelProxy.traceStartTime() - startTime) * spacing; ctxt.fillRect(0, 0, rectWidth, height); } - if (endTime > qmlProfilerDataModel.traceEndTime()) { + if (endTime > qmlProfilerModelProxy.traceEndTime()) { ctxt.fillStyle = "rgba(127,127,127,0.2)"; - var rectX = (qmlProfilerDataModel.traceEndTime() - startTime) * spacing; - rectWidth = (endTime - qmlProfilerDataModel.traceEndTime()) * spacing; + var rectX = (qmlProfilerModelProxy.traceEndTime() - startTime) * spacing; + rectWidth = (endTime - qmlProfilerModelProxy.traceEndTime()) * spacing; ctxt.fillRect(rectX, 0, rectWidth, height); } + } function updateMarks(start, end) { @@ -121,16 +128,16 @@ Canvas2D { // separators var cumulatedHeight = 0; - for (var i=0; i