From 8c64d132fd64375bf2f07b81481ac052b5945b77 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Wed, 16 Nov 2011 16:08:05 +0100 Subject: [PATCH] QmlProfiler: improved look of the timeline UI Change-Id: I5d79394529f3ba303e7353a60df77f59bbe38a12 Reviewed-by: Aurindam Jana --- .../qmljsdebugclient/qmlprofilereventlist.cpp | 4 +- src/plugins/qmlprofiler/qml/Detail.qml | 3 +- src/plugins/qmlprofiler/qml/Label.qml | 47 ++++-- src/plugins/qmlprofiler/qml/MainView.qml | 64 ++++++-- src/plugins/qmlprofiler/qml/Overview.js | 96 ++++++++++-- src/plugins/qmlprofiler/qml/Overview.qml | 2 +- src/plugins/qmlprofiler/qml/RangeDetails.qml | 146 ++++++++++++------ src/plugins/qmlprofiler/qml/RangeMover.qml | 67 +++++--- .../qmlprofiler/qml/SelectionRange.qml | 76 ++++++--- .../qmlprofiler/qml/SelectionRangeDetails.qml | 127 ++++++++++----- src/plugins/qmlprofiler/qml/TimeDisplay.qml | 37 ++++- src/plugins/qmlprofiler/qml/TimeMarks.qml | 30 +++- src/plugins/qmlprofiler/qml/arrow_down.png | Bin 208 -> 190 bytes src/plugins/qmlprofiler/qml/arrow_right.png | Bin 209 -> 191 bytes src/plugins/qmlprofiler/qml/arrow_select.png | Bin 609 -> 0 bytes .../qmlprofiler/qml/clean_pane_small.png | Bin 713 -> 677 bytes src/plugins/qmlprofiler/qml/dialog_shadow.png | Bin 0 -> 664 bytes src/plugins/qmlprofiler/qml/ico_next.png | Bin 0 -> 192 bytes src/plugins/qmlprofiler/qml/ico_prev.png | Bin 0 -> 193 bytes .../qmlprofiler/qml/ico_rangeselected.png | Bin 0 -> 188 bytes .../qmlprofiler/qml/ico_rangeselection.png | Bin 0 -> 200 bytes .../qmlprofiler/qml/ico_selectionmode.png | Bin 0 -> 203 bytes src/plugins/qmlprofiler/qml/ico_zoom.png | Bin 0 -> 461 bytes src/plugins/qmlprofiler/qml/lock_closed.png | Bin 297 -> 276 bytes src/plugins/qmlprofiler/qml/lock_open.png | Bin 283 -> 265 bytes src/plugins/qmlprofiler/qml/magnifier.png | Bin 281 -> 0 bytes src/plugins/qmlprofiler/qml/next.png | Bin 908 -> 0 bytes src/plugins/qmlprofiler/qml/popup_green.png | Bin 1538 -> 0 bytes src/plugins/qmlprofiler/qml/popup_orange.png | Bin 1364 -> 0 bytes src/plugins/qmlprofiler/qml/prev.png | Bin 911 -> 0 bytes src/plugins/qmlprofiler/qml/qmlprofiler.qrc | 16 +- src/plugins/qmlprofiler/qml/range.png | Bin 274 -> 0 bytes src/plugins/qmlprofiler/qml/range_handle.png | Bin 0 -> 197 bytes src/plugins/qmlprofiler/qml/range_pressed.png | Bin 266 -> 0 bytes src/plugins/qmlprofiler/qml/recordOff.png | Bin 589 -> 496 bytes src/plugins/qmlprofiler/qml/recordOn.png | Bin 632 -> 614 bytes src/plugins/qmlprofiler/timelineview.cpp | 43 ++---- src/plugins/qmlprofiler/timelineview.h | 3 +- src/plugins/qmlprofiler/tracewindow.cpp | 46 ++++-- src/plugins/qmlprofiler/tracewindow.h | 17 +- 40 files changed, 575 insertions(+), 249 deletions(-) delete mode 100644 src/plugins/qmlprofiler/qml/arrow_select.png create mode 100644 src/plugins/qmlprofiler/qml/dialog_shadow.png create mode 100644 src/plugins/qmlprofiler/qml/ico_next.png create mode 100644 src/plugins/qmlprofiler/qml/ico_prev.png create mode 100644 src/plugins/qmlprofiler/qml/ico_rangeselected.png create mode 100644 src/plugins/qmlprofiler/qml/ico_rangeselection.png create mode 100644 src/plugins/qmlprofiler/qml/ico_selectionmode.png create mode 100644 src/plugins/qmlprofiler/qml/ico_zoom.png delete mode 100644 src/plugins/qmlprofiler/qml/magnifier.png delete mode 100644 src/plugins/qmlprofiler/qml/next.png delete mode 100644 src/plugins/qmlprofiler/qml/popup_green.png delete mode 100644 src/plugins/qmlprofiler/qml/popup_orange.png delete mode 100644 src/plugins/qmlprofiler/qml/prev.png delete mode 100644 src/plugins/qmlprofiler/qml/range.png create mode 100644 src/plugins/qmlprofiler/qml/range_handle.png delete mode 100644 src/plugins/qmlprofiler/qml/range_pressed.png diff --git a/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp b/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp index df9e5dfb71d..5c5714ca5c8 100644 --- a/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp +++ b/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp @@ -1184,13 +1184,13 @@ int QmlProfilerEventList::getEventId(int index) const { int QmlProfilerEventList::uniqueEventsOfType(int type) const { if (!d->m_typeCounts.contains(type)) - return 1; + return 0; return d->m_typeCounts[type]->eventIds.count(); } int QmlProfilerEventList::maxNestingForType(int type) const { if (!d->m_typeCounts.contains(type)) - return 1; + return 0; return d->m_typeCounts[type]->nestingCount; } diff --git a/src/plugins/qmlprofiler/qml/Detail.qml b/src/plugins/qmlprofiler/qml/Detail.qml index b8fd301769a..509b8c353bd 100644 --- a/src/plugins/qmlprofiler/qml/Detail.qml +++ b/src/plugins/qmlprofiler/qml/Detail.qml @@ -39,7 +39,7 @@ Item { property string content signal linkActivated(string url) - height: childrenRect.height + height: childrenRect.height+2 width: childrenRect.width Item { id: guideline @@ -47,6 +47,7 @@ Item { width: 5 } Text { + y: 1 id: lbl text: label font.pixelSize: 12 diff --git a/src/plugins/qmlprofiler/qml/Label.qml b/src/plugins/qmlprofiler/qml/Label.qml index 575e52948eb..6f3f9d8705f 100644 --- a/src/plugins/qmlprofiler/qml/Label.qml +++ b/src/plugins/qmlprofiler/qml/Label.qml @@ -33,11 +33,12 @@ import QtQuick 1.0 Item { + id: labelContainer property alias text: txt.text property bool expanded: false property int typeIndex: index - property variant descriptions: [text] + property variant descriptions: [] height: root.singleRowHeight width: 150 @@ -56,8 +57,8 @@ Item { } function updateHeight() { - height = root.singleRowHeight * - (expanded ? qmlEventList.uniqueEventsOfType(typeIndex) : qmlEventList.maxNestingForType(typeIndex)); + height = root.singleRowHeight * (1 + + (expanded ? qmlEventList.uniqueEventsOfType(typeIndex) : qmlEventList.maxNestingForType(typeIndex))); } Connections { @@ -66,55 +67,67 @@ Item { var desc=[]; for (var i=0; i 0 source: expanded ? "arrow_down.png" : "arrow_right.png" x: parent.width - 12 - y: 2 + y: root.singleRowHeight / 2 - height / 2 MouseArea { anchors.fill: parent + anchors.rightMargin: -10 + anchors.leftMargin: -10 + anchors.topMargin: -10 + anchors.bottomMargin: -10 onClicked: { expanded = !expanded; } diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index e682aeff056..7f04b793491 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -39,6 +39,7 @@ Rectangle { // ***** properties property int candidateHeight: 0 + property int scrollY: 0 height: Math.max( candidateHeight, labels.height + 2 ) property int singleRowHeight: 30 @@ -132,9 +133,12 @@ Rectangle { function clearData() { view.clearData(); - root.dataAvailable = false; - root.eventCount = 0; + dataAvailable = false; + eventCount = 0; hideRangeDetails(); + selectionRangeMode = false; + updateRangeButton(); + zoomControl.setRange(0,0); } function clearDisplay() { @@ -493,14 +497,6 @@ Rectangle { } } } - - //right border divider - Rectangle { - width: 1 - height: parent.height - anchors.right: parent.right - color: "#cccccc" - } } Rectangle { @@ -516,4 +512,52 @@ Rectangle { anchors.verticalCenter: labels.verticalCenter z:3 } + + // Gradient borders + Item { + anchors.left: labels.right + width: 6 + anchors.top: root.top + anchors.bottom: root.bottom + Rectangle { + x: parent.width + transformOrigin: Item.TopLeft + rotation: 90 + width: parent.height + height: parent.width + gradient: Gradient { + GradientStop { position: 0.0; color: "#00A0A0A0"; } + GradientStop { position: 1.0; color: "#FFA0A0A0"; } + } + } + } + + Item { + anchors.right: root.right + width: 6 + anchors.top: root.top + anchors.bottom: root.bottom + Rectangle { + x: parent.width + transformOrigin: Item.TopLeft + rotation: 90 + width: parent.height + height: parent.width + gradient: Gradient { + GradientStop { position: 0.0; color: "#FFA0A0A0"; } + GradientStop { position: 1.0; color: "#00A0A0A0"; } + } + } + } + + Rectangle { + y: root.scrollY + root.candidateHeight - height + height: 6 + width: root.width + x: 0 + gradient: Gradient { + GradientStop { position: 0.0; color: "#00A0A0A0"; } + GradientStop { position: 1.0; color: "#FFA0A0A0"; } + } + } } diff --git a/src/plugins/qmlprofiler/qml/Overview.js b/src/plugins/qmlprofiler/qml/Overview.js index 4bec74179bf..5cfe715bf1e 100644 --- a/src/plugins/qmlprofiler/qml/Overview.js +++ b/src/plugins/qmlprofiler/qml/Overview.js @@ -37,11 +37,7 @@ var qmlEventList = 0; //draw background of the graph function drawGraph(canvas, ctxt, region) { - var grad = ctxt.createLinearGradient(0, 0, 0, canvas.height); - grad.addColorStop(0, '#fff'); - grad.addColorStop(1, '#ccc'); - ctxt.fillStyle = grad; - + ctxt.fillStyle = "#eaeaea"; ctxt.fillRect(0, 0, canvas.width, canvas.height); } @@ -51,40 +47,106 @@ function drawData(canvas, ctxt, region) if ((!qmlEventList) || qmlEventList.count() == 0) return; + var typeCount = 5; var width = canvas.width; - var height = canvas.height; + var bump = 10; + var height = canvas.height - bump; + var blockHeight = height / typeCount; var spacing = width / qmlEventList.traceDuration(); - ctxt.fillStyle = "rgba(0,0,0,1)"; - var highest = [0,0,0,0,0]; + var highest = [0,0,0,0,0]; // note: change if typeCount changes - // todo: use "region" in the timemarks? - //### only draw those in range for (var ii = 0; ii < qmlEventList.count(); ++ii) { var xx = (qmlEventList.getStartTime(ii) - qmlEventList.traceStartTime()) * spacing; if (xx > region.x + region.width) continue; - var size = qmlEventList.getDuration(ii) * spacing; - if (xx + size < region.x) + var eventWidth = qmlEventList.getDuration(ii) * spacing; + if (xx + eventWidth < region.x) continue; - if (size < 0.5) - size = 0.5; + if (eventWidth < 1) + eventWidth = 1; xx = Math.round(xx); var ty = qmlEventList.getType(ii); - if (xx + size > highest[ty]) { - ctxt.fillRect(xx, ty*10, size, 10); - highest[ty] = xx+size; + if (xx + eventWidth > highest[ty]) { + var hue = ( qmlEventList.getEventId(ii) * 25 ) % 360; + ctxt.fillStyle = "hsl("+(hue/360.0+0.001)+",0.3,0.65)"; + ctxt.fillRect(xx, bump + ty*blockHeight, eventWidth, blockHeight); + highest[ty] = xx+eventWidth; } } } +function drawTimeBar(canvas, ctxt, region) +{ + var width = canvas.width; + var height = 10; + var startTime = qmlEventList.traceStartTime(); + var endTime = qmlEventList.traceEndTime(); + + var totalTime = qmlEventList.traceDuration(); + var spacing = width / totalTime; + + var initialBlockLength = 120; + var timePerBlock = Math.pow(2, Math.floor( Math.log( totalTime / width * initialBlockLength ) / Math.LN2 ) ); + var pixelsPerBlock = timePerBlock * spacing; + var pixelsPerSection = pixelsPerBlock / 5; + var blockCount = width / pixelsPerBlock; + + var realStartTime = Math.floor(startTime/timePerBlock) * timePerBlock; + var realStartPos = (startTime-realStartTime) * spacing; + + var timePerPixel = timePerBlock/pixelsPerBlock; + + ctxt.fillStyle = "#000000"; + ctxt.font = "6px sans-serif"; + + ctxt.fillStyle = "#cccccc"; + ctxt.fillRect(0, 0, width, height); + for (var ii = 0; ii < blockCount+1; ii++) { + var x = Math.floor(ii*pixelsPerBlock - realStartPos); + + // block boundary + ctxt.strokeStyle = "#525252"; + ctxt.beginPath(); + ctxt.moveTo(x, height/2); + ctxt.lineTo(x, height); + ctxt.stroke(); + + // block time label + ctxt.fillStyle = "#000000"; + var timeString = prettyPrintTime((ii+0.5)*timePerBlock + realStartTime); + ctxt.textAlign = "center"; + ctxt.fillText(timeString, x + pixelsPerBlock/2, height/2 + 3); + } + + ctxt.fillStyle = "#808080"; + ctxt.fillRect(0, height-1, width, 1); +} + +function prettyPrintTime( t ) +{ + if (t <= 0) return "0"; + if (t<1000) return t+" ns"; + t = t/1000; + if (t<1000) return t+" μs"; + t = Math.floor(t/100)/10; + if (t<1000) return t+" ms"; + t = Math.floor(t)/1000; + if (t<60) return t+" s"; + var m = Math.floor(t/60); + t = Math.floor(t - m*60); + return m+"m"+t+"s"; +} + function plot(canvas, ctxt, region) { drawGraph(canvas, ctxt, region); drawData(canvas, ctxt, region); + drawTimeBar(canvas, ctxt, region); + } diff --git a/src/plugins/qmlprofiler/qml/Overview.qml b/src/plugins/qmlprofiler/qml/Overview.qml index 83ac454087c..54b89f463e5 100644 --- a/src/plugins/qmlprofiler/qml/Overview.qml +++ b/src/plugins/qmlprofiler/qml/Overview.qml @@ -124,6 +124,6 @@ Canvas2D { Rectangle { height: 1 width: parent.width - color: "#cccccc" + color: "#858585" } } diff --git a/src/plugins/qmlprofiler/qml/RangeDetails.qml b/src/plugins/qmlprofiler/qml/RangeDetails.qml index b2b24a4dc4c..9e3d574a789 100644 --- a/src/plugins/qmlprofiler/qml/RangeDetails.qml +++ b/src/plugins/qmlprofiler/qml/RangeDetails.qml @@ -33,7 +33,7 @@ import QtQuick 1.0 import Monitor 1.0 -BorderImage { +Item { id: rangeDetails property string duration @@ -44,72 +44,115 @@ BorderImage { property bool locked: view.selectionLocked - source: "popup_green.png" - border { - left: 10; top: 10 - right: 20; bottom: 20 - } - width: col.width + 45 - height: childrenRect.height + height: col.height + 30 z: 1 visible: false x: 200 y: 25 + // shadow + BorderImage { + property int px: 4 + source: "dialog_shadow.png" + + border { + left: px; top: px + right: px; bottom: px + } + width: parent.width + 2*px - 1 + height: parent.height + x: -px + 1 + y: px + 1 + } + + // title bar + Rectangle { + width: parent.width + height: 20 + color: "#55a3b8" + radius: 5 + border.width: 1 + border.color: "#a0a0a0" + } + Item { + width: parent.width+1 + height: 11 + y: 10 + clip: true + Rectangle { + width: parent.width-1 + height: 15 + y: -5 + color: "#55a3b8" + border.width: 1 + border.color: "#a0a0a0" + } + } + //title Text { id: typeTitle - text: rangeDetails.type + text: " "+rangeDetails.type font.bold: true - y: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: -5 + height: 18 + y: 2 + verticalAlignment: Text.AlignVCenter + width: parent.width + color: "white" } - //details - Column { - id: col - anchors.top: typeTitle.bottom - x: 2 - Detail { - label: qsTr("Duration") - content: rangeDetails.duration < 1000 ? - rangeDetails.duration + "μs" : - Math.floor(rangeDetails.duration/10)/100 + "ms" - } - Detail { - opacity: content.length !== 0 ? 1 : 0 - label: qsTr("Details") - content: { - var inputString = rangeDetails.label; - if (inputString.length > 7 && inputString.substring(0,7) == "file://") { - var pos = inputString.lastIndexOf("/"); - return inputString.substr(pos+1); - } - var maxLen = 40; - if (inputString.length > maxLen) - inputString = inputString.substring(0,maxLen)+"..."; + // Details area + Rectangle { + color: "white" + width: parent.width + height: col.height + 10 + y: 20 + border.width: 1 + border.color: "#a0a0a0" - return inputString; + //details + Column { + id: col + x: 10 + y: 5 + Detail { + label: qsTr("Duration:") + content: rangeDetails.duration < 1000 ? rangeDetails.duration + "μs" : Math.floor(rangeDetails.duration/10)/100 + "ms" } - } - Detail { - opacity: content.length !== 0 ? 1 : 0 - label: qsTr("Location") - content: { - var file = rangeDetails.file; - var pos = file.lastIndexOf("/"); - if (pos != -1) - file = file.substr(pos+1); - return (file.length !== 0) ? (file + ":" + rangeDetails.line) : ""; + Detail { + opacity: content.length !== 0 ? 1 : 0 + label: qsTr("Details:") + content: { + var inputString = rangeDetails.label; + if (inputString.length > 7 && inputString.substring(0,7) == "file://") { + var pos = inputString.lastIndexOf("/"); + return inputString.substr(pos+1); + } + var maxLen = 40; + if (inputString.length > maxLen) + inputString = inputString.substring(0,maxLen)+"..."; + + return inputString; + } + } + Detail { + opacity: content.length !== 0 ? 1 : 0 + label: qsTr("Location:") + content: { + var file = rangeDetails.file; + var pos = file.lastIndexOf("/"); + if (pos != -1) + file = file.substr(pos+1); + return (file.length !== 0) ? (file + ":" + rangeDetails.line) : ""; + } } } } MouseArea { - width: col.width + 30 - height: col.height + typeTitle.height + 30 + width: col.width + 45 + height: col.height + 30 drag.target: parent onClicked: { root.gotoSourceLocation(file, line); @@ -133,11 +176,13 @@ BorderImage { } } + Text { id: closeIcon - x: col.width + 20 - y: 10 + x: col.width + 30 + y: 4 text:"X" + color: "white" MouseArea { anchors.fill: parent onClicked: { @@ -147,5 +192,4 @@ BorderImage { } } - } diff --git a/src/plugins/qmlprofiler/qml/RangeMover.qml b/src/plugins/qmlprofiler/qml/RangeMover.qml index 9cfff4ba903..39cebfda1c2 100644 --- a/src/plugins/qmlprofiler/qml/RangeMover.qml +++ b/src/plugins/qmlprofiler/qml/RangeMover.qml @@ -36,14 +36,13 @@ Rectangle { id: rangeMover - property color lighterColor:"#cc80b2f6" - property color darkerColor:"#cc6da1e8" - property color gapColor: "#666da1e8" - property color hardBorderColor: "blue" + property color rangeColor:"#444a64b8" + property color borderColor:"#cc4a64b8" + property color dragMarkerColor: "#4a64b8" width: 20 height: 50 - color: lighterColor + color: rangeColor property bool dragStarted: false onXChanged: { @@ -74,16 +73,30 @@ Rectangle { x: 0 height: parent.height width: 1 - color: darkerColor - border.color: hardBorderColor - border.width: 0 + color: borderColor + + Rectangle { + id: leftBorderHandle + height: parent.height + x: -width + width: 7 + color: "#869cd1" + visible: false + Image { + source: "range_handle.png" + x: 2 + width: 4 + height: 9 + fillMode: Image.Tile + y: rangeMover.height / 2 - 4 + } + } states: State { name: "highlighted" PropertyChanges { - target: leftRange - width: 3 - border.width: 2 + target: leftBorderHandle + visible: true } } @@ -97,8 +110,8 @@ Rectangle { } MouseArea { - x: -3 - width: 7 + x: -10 + width: 13 y: 0 height: parent.height @@ -131,16 +144,30 @@ Rectangle { x: rangeMover.width height: parent.height width: 1 - color: darkerColor - border.color: hardBorderColor - border.width: 0 + color: borderColor + + Rectangle { + id: rightBorderHandle + height: parent.height + x: 1 + width: 7 + color: "#869cd1" + visible: false + Image { + source: "range_handle.png" + x: 2 + width: 4 + height: 9 + fillMode: Image.Tile + y: rangeMover.height / 2 - 4 + } + } states: State { name: "highlighted" PropertyChanges { - target: rightRange - width: 3 - border.width: 2 + target: rightBorderHandle + visible: true } } @@ -153,7 +180,7 @@ Rectangle { MouseArea { x: -3 - width: 7 + width: 13 y: 0 height: parent.height diff --git a/src/plugins/qmlprofiler/qml/SelectionRange.qml b/src/plugins/qmlprofiler/qml/SelectionRange.qml index 6c9a9b9c833..9565f2256b7 100644 --- a/src/plugins/qmlprofiler/qml/SelectionRange.qml +++ b/src/plugins/qmlprofiler/qml/SelectionRange.qml @@ -40,11 +40,11 @@ Rectangle { property bool ready: visible && creationState === 3 - property color lighterColor:"#6680b2f6" - property color darkerColor:"#666da1e8" - property color gapColor: "#336da1e8" - property color hardBorderColor: "#aa6da1e8" - property color thinColor: "blue" + property color rangeColor:"#444a64b8" + property color pressedColor:"#664a64b8" + property color borderColor:"#aa4a64b8" + property color dragMarkerColor: "#4a64b8" + property color singleLineColor: "#4a64b8" property string startTimeString: detailedPrintTime(startTime) property string endTimeString: detailedPrintTime(startTime+duration) @@ -77,16 +77,16 @@ Rectangle { onCreationStateChanged: { switch (creationState) { case 0: color = "transparent"; break; - case 1: color = thinColor; break; - default: color = lighterColor; break; + case 1: color = singleLineColor; break; + default: color = rangeColor; break; } } onIsDraggingChanged: { if (isDragging) - color = darkerColor; + color = pressedColor; else - color = lighterColor; + color = rangeColor; } function reset(setVisible) { @@ -172,16 +172,30 @@ Rectangle { x: 0 height: parent.height width: 1 - color: darkerColor - border.color: hardBorderColor - border.width: 0 + color: borderColor + + Rectangle { + id: leftBorderHandle + height: parent.height + x: -width + width: 9 + color: "#869cd1" + visible: false + Image { + source: "range_handle.png" + x: 4 + width: 4 + height: 63 + fillMode: Image.Tile + y: root.scrollY + root.candidateHeight / 2 - 32 + } + } states: State { name: "highlighted" PropertyChanges { - target: leftBorder - width: 3 - border.width: 2 + target: leftBorderHandle + visible: true } } @@ -192,8 +206,8 @@ Rectangle { } MouseArea { - x: -3 - width: 7 + x: -12 + width: 15 y: 0 height: parent.height @@ -226,16 +240,30 @@ Rectangle { x: selectionRange.width height: parent.height width: 1 - color: darkerColor - border.color: hardBorderColor - border.width: 0 + color: borderColor + + Rectangle { + id: rightBorderHandle + height: parent.height + x: 1 + width: 9 + color: "#869cd1" + visible: false + Image { + source: "range_handle.png" + x: 2 + width: 4 + height: 63 + fillMode: Image.Tile + y: root.scrollY + root.candidateHeight / 2 - 32 + } + } states: State { name: "highlighted" PropertyChanges { - target: rightBorder - width: 3 - border.width: 2 + target: rightBorderHandle + visible: true } } @@ -247,7 +275,7 @@ Rectangle { MouseArea { x: -3 - width: 7 + width: 15 y: 0 height: parent.height diff --git a/src/plugins/qmlprofiler/qml/SelectionRangeDetails.qml b/src/plugins/qmlprofiler/qml/SelectionRangeDetails.qml index c3bc2d2e75c..f337825e3a1 100644 --- a/src/plugins/qmlprofiler/qml/SelectionRangeDetails.qml +++ b/src/plugins/qmlprofiler/qml/SelectionRangeDetails.qml @@ -33,7 +33,7 @@ import QtQuick 1.0 import Monitor 1.0 -BorderImage { +Item { id: selectionRangeDetails property string startTime @@ -41,55 +41,110 @@ BorderImage { property string duration property bool showDuration - source: "popup_orange.png" - border { - left: 10; top: 10 - right: 20; bottom: 20 - } - width: 170 - height: childrenRect.height + height: col.height + 30 z: 1 visible: false x: 200 y: 125 + // shadow + BorderImage { + property int px: 4 + source: "dialog_shadow.png" + + border { + left: px; top: px + right: px; bottom: px + } + width: parent.width + 2*px - 1 + height: parent.height + x: -px + 1 + y: px + 1 + } + + // title bar + Rectangle { + width: parent.width + height: 20 + color: "#4a64b8" + radius: 5 + border.width: 1 + border.color: "#a0a0a0" + } + Item { + width: parent.width+1 + height: 11 + y: 10 + clip: true + Rectangle { + width: parent.width-1 + height: 15 + y: -5 + color: "#4a64b8" + border.width: 1 + border.color: "#a0a0a0" + } + } + //title Text { id: typeTitle - text: qsTr("Selection") + text: " "+qsTr("Selection") font.bold: true - y: 10 - anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: -5 + height: 18 + y: 2 + verticalAlignment: Text.AlignVCenter + width: parent.width + color: "white" } - //details - Column { - id: col - anchors.top: typeTitle.bottom - x: 2 - Detail { - label: qsTr("Start") - content: selectionRangeDetails.startTime + // Details area + Rectangle { + color: "white" + width: parent.width + height: col.height + 10 + y: 20 + border.width: 1 + border.color: "#a0a0a0" + Column { + id: col + x: 10 + y: 5 + Detail { + label: qsTr("Start") + content: selectionRangeDetails.startTime + } + Detail { + label: qsTr("End") + visible: selectionRangeDetails.showDuration + content: selectionRangeDetails.endTime + } + Detail { + label: qsTr("Duration") + visible: selectionRangeDetails.showDuration + content: selectionRangeDetails.duration + } } - Detail { - label: qsTr("End") - visible: selectionRangeDetails.showDuration - content: selectionRangeDetails.endTime - } - Detail { - label: qsTr("Duration") - visible: selectionRangeDetails.showDuration - content: selectionRangeDetails.duration + } + + MouseArea { + width: col.width + 45 + height: col.height + 30 + drag.target: parent + onClicked: { + if ((selectionRange.x < flick.contentX) ^ (selectionRange.x+selectionRange.width > flick.contentX + flick.width)) { + root.recenter(selectionRange.startTime + selectionRange.duration/2); + } } } Text { id: closeIcon - x: selectionRangeDetails.width - 24 - y: 10 + x: selectionRangeDetails.width - 14 + y: 4 text:"X" + color: "white" MouseArea { anchors.fill: parent anchors.leftMargin: -8 @@ -100,14 +155,4 @@ BorderImage { } } - MouseArea { - width: col.width - height: col.height + typeTitle.height + 30 - drag.target: parent - onClicked: { - if ((selectionRange.x < flick.contentX) ^ (selectionRange.x+selectionRange.width > flick.contentX + flick.width)) { - root.recenter(selectionRange.startTime + selectionRange.duration/2); - } - } - } } diff --git a/src/plugins/qmlprofiler/qml/TimeDisplay.qml b/src/plugins/qmlprofiler/qml/TimeDisplay.qml index 3b8c9987517..0efba45bdda 100644 --- a/src/plugins/qmlprofiler/qml/TimeDisplay.qml +++ b/src/plugins/qmlprofiler/qml/TimeDisplay.qml @@ -78,19 +78,52 @@ Canvas2D { timePerPixel = timePerBlock/pixelsPerBlock; + var initialColor = Math.floor(realStartTime/timePerBlock) % 2; ctxt.fillStyle = "#000000"; ctxt.font = "8px sans-serif"; for (var ii = 0; ii < blockCount+1; ii++) { var x = Math.floor(ii*pixelsPerBlock - realStartPos); - ctxt.strokeStyle = "#C0C0C0"; + + ctxt.fillStyle = (ii+initialColor)%2 ? "#E6E6E6":"white"; + ctxt.fillRect(x, 0, pixelsPerBlock, height); + + ctxt.strokeStyle = "#B0B0B0"; ctxt.beginPath(); ctxt.moveTo(x, 0); ctxt.lineTo(x, height); ctxt.stroke(); - ctxt.fillText(prettyPrintTime(ii*timePerBlock + realStartTime), x + 5, height/2 + 4); + ctxt.fillStyle = "#000000"; + ctxt.fillText(prettyPrintTime(ii*timePerBlock + realStartTime), x + 5, height/2 + 5); } + + ctxt.strokeStyle = "#525252"; + ctxt.beginPath(); + ctxt.moveTo(0, height-1); + ctxt.lineTo(width, height-1); + ctxt.stroke(); + + // gradient borders + var gradientDark = "rgba(160, 160, 160, 1)"; + var gradientClear = "rgba(160, 160, 160, 0)"; + var grad = ctxt.createLinearGradient(0, 0, 0, 6); + grad.addColorStop(0,gradientDark); + grad.addColorStop(1,gradientClear); + ctxt.fillStyle = grad; + ctxt.fillRect(0, 0, width, 6); + + grad = ctxt.createLinearGradient(0, 0, 6, 0); + grad.addColorStop(0,gradientDark); + grad.addColorStop(1,gradientClear); + ctxt.fillStyle = grad; + ctxt.fillRect(0, 0, 6, height); + + grad = ctxt.createLinearGradient(width, 0, width-6, 0); + grad.addColorStop(0,gradientDark); + grad.addColorStop(1,gradientClear); + ctxt.fillStyle = grad; + ctxt.fillRect(width-6, 0, 6, height); } function prettyPrintTime( t ) diff --git a/src/plugins/qmlprofiler/qml/TimeMarks.qml b/src/plugins/qmlprofiler/qml/TimeMarks.qml index d8a72b0ee2c..5d05a209a2a 100644 --- a/src/plugins/qmlprofiler/qml/TimeMarks.qml +++ b/src/plugins/qmlprofiler/qml/TimeMarks.qml @@ -73,13 +73,13 @@ Canvas2D { ctxt.font = "8px sans-serif"; for (var ii = 0; ii < blockCount+1; ii++) { var x = Math.floor(ii*pixelsPerBlock - realStartPos); - ctxt.strokeStyle = "#C0C0C0"; + ctxt.strokeStyle = "#B0B0B0"; ctxt.beginPath(); ctxt.moveTo(x, 0); ctxt.lineTo(x, height); ctxt.stroke(); - ctxt.strokeStyle = "#E0E0E0"; + ctxt.strokeStyle = "#CCCCCC"; for (var jj=1; jj < 5; jj++) { var xx = Math.floor(ii*pixelsPerBlock + jj*pixelsPerSection - realStartPos); ctxt.beginPath(); @@ -113,16 +113,30 @@ Canvas2D { } function drawBackgroundBars( ctxt, region ) { + var colorIndex = true; + // row background + for (var y=0; y < labels.height; y+= root.singleRowHeight) { + ctxt.fillStyle = colorIndex ? "#f0f0f0" : "white"; + ctxt.strokeStyle = colorIndex ? "#f0f0f0" : "white"; + ctxt.fillRect(0, y, width, root.singleRowHeight); + colorIndex = !colorIndex; + } + + // separators var cumulatedHeight = 0; for (var i=0; ixQ}sy;Y4Q{PHr&)dAYfN-cO#GkpTczg9tSM delta 38 scmdnTc!6<(AwOG^x4R3&e-K=-clqRrdh(oHQv8e>&rX|9m>8A;01z$?Jpcdz diff --git a/src/plugins/qmlprofiler/qml/arrow_right.png b/src/plugins/qmlprofiler/qml/arrow_right.png index 228529f0ff2924583c016bb3e282294c9f3296c3..9b6c170f57a45ee344d6ce87f2e84fb4d4a82b95 100644 GIT binary patch delta 22 dcmcb}xSw%?;Y4Q{PHr&)c}-PEuQ?MlG673R26O-b delta 38 scmdnbc#&~}AwOG^x4R3&e-K=-clqRrdh(oHQv3{Bg7?z@P7KQg01d+q8~^|S diff --git a/src/plugins/qmlprofiler/qml/arrow_select.png b/src/plugins/qmlprofiler/qml/arrow_select.png deleted file mode 100644 index e1e2d4a5b1f594c0cc25ceae2e66f3b478cd65e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 609 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s77>k44ofy`glX=O&z`&N| z?e4CEEc{X*&4jeh7@!{3k+5d&reSW!|U{I5I{IL1Be?(+t{FA4thAURBsu2(q z+LfA>qvtiLSnbPqzdiNepZ)*;zwY1e%EzbvvwnVlZ|la5q6rBJ2`4=KlT|Vtd`i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3EjrC#OXatAM=zvr{2yDzgqLf% Urzu@wU|?YIboFyt=akR{0LO?C6951J literal 0 HcmV?d00001 diff --git a/src/plugins/qmlprofiler/qml/ico_next.png b/src/plugins/qmlprofiler/qml/ico_next.png new file mode 100644 index 0000000000000000000000000000000000000000..57ed827107febd019db0498687f335ff250fa686 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRdCT0c(hNQXTpBNYz7>k44ofy`glX=O&z`$AH z5n0T@z%2yAjF;}#{b68WU@!6Xb!ETJEheDAyi8?f8Ax4#Plzi61B0ff=KufyH%&Er z3o@xB$S;_|;n|He1_lNLPZ!4!j_b(@4GioGX>%BqrZsd-<>6VhaJ7uYlCZV27?h?t mL?jq)&k44ofy`glX=O&z`$AH z5n0T@z%2yAjF;}#{b68WU@!6Xb!ETJEhZqZw)I~)FGyX0Plzi61B0ff=KufyH%&Er z3o@xB$S;_|;n|He1_lO0PZ!4!j_b(@49so<2cI#hEOBrVn~)GADs||k44ofy`glX=O&z`$AH z5n0T@z%2yAjF;}#{b68WU@!6Xb!ETJEhZqZw_EkTJxE=EPlzi61B0ff=KufyH%&Er z3o@xB$S;_|;n|He1_lNlPZ!4!j_b(@42=S8Y=Lb73Jz*P%8f@Ztq5q_5W0Gq6NiDg hQsXL#90m>s2F?`WY#XNb$qWn(44$rjF6*2UngAVPFr@$h literal 0 HcmV?d00001 diff --git a/src/plugins/qmlprofiler/qml/ico_rangeselection.png b/src/plugins/qmlprofiler/qml/ico_rangeselection.png new file mode 100644 index 0000000000000000000000000000000000000000..cc222d960f391f0c00ba8ba257a2f409d57e14d9 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRdCT0c(hNQXTpBNYz7>k44ofy`glX=O&z`zsW z6XKexn+_6ZWc>gC|5i~iQxK;l$S;_|;n|He1_lPs0*}aI1_o{+5N5n|x9$%E0|R@B zr>`sfZEi6E1@0C96k44ofy`glX=O&z`$AH z5n0T@z%2yAjF;}#{b68WU@!6Xb!ETJEhZpuXr_DV6axbTPk>K|D+2?Arl#hZbLam5 z|IgTB$Okg4B*-tA!Qt7BGzJC+3r`ov5RU7~2@H(0`3;DD z=(z14Cv&q+N5X%86$wWc=W9X=ic$<_oD7Nye0v)*niCip7#KWV{an^LB{Ts5BY8Dh literal 0 HcmV?d00001 diff --git a/src/plugins/qmlprofiler/qml/ico_zoom.png b/src/plugins/qmlprofiler/qml/ico_zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..d86a3b5acd846c09ded0e6061b3d88cb13f627a6 GIT binary patch literal 461 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s77>k44ofy`glX=O&z`$AH z5n0T@z%2yAjF;}#{b68WU@!6Xb!ETJEheDAV6Xe*3>n6w7>;xC<%PHCC_TEc@MgCX z$4~36&Zl`@e)*Z^yI79Gr=q|%ssTfj+XDwEQoqMa>W zN0S(pnt}o}L?)v0xt$mo7?yduIEHAPKRa;H`m+%8+jH}PE+He0i zO`m(_`@6@!@6u=2Xl%UCFMGaqH+H0#J#-D z1`;mwBO3${vH473%-FesFc#=Fi)mau;-MIu*HBlR?senO~uoYvpFi z6Dkucyr;-;I4EcKJdFVdQ&MBb@0C;v_JOBUy diff --git a/src/plugins/qmlprofiler/qml/lock_open.png b/src/plugins/qmlprofiler/qml/lock_open.png index 07db58125027d3377b131e2695f30485d9b64142..ab6c820dfbd9508ed53edd93a0ff1b6a2e283929 100644 GIT binary patch delta 199 zcmbQu)X6l#aH6wJJ-3*E0^2pe*q;mx46{95978nDpS`3n#F!{?;Nf&F&9pz3P24jI z8+*@abXo6cNh!Hrz!)mP(zRnY%cO-f+&7$j({uNkX8zB*&-)&7^K3jI>i=frL58(I z+P3y{`~7UOp7x@iz2FFoY{|w$lA2Pk2e&1B=6Jhka@>uDlBo%^^Jm&l=S{0DIIzXX z;Mn1Oa~0Dif)~4sHc7d#eqHgxzj@7}-#QbX%zrao;M1& delta 215 zcmeBVn$0x9ke@Bd+ueoXKL{?^yL|FQJ^6Z0DLz&s%jMFX3=9mjJzX3_G|r#BV93W9 zDAM|nf2o)9L9rZ%B<9PC8wFW_j{cDTwtoSqoZug`@RTHB#llZfHj_fb1M9g&ME|tj$o1N4xygLFfz9=M U`Rd;o7#J8lUHx3vIVCg!06WrF!vFvP diff --git a/src/plugins/qmlprofiler/qml/magnifier.png b/src/plugins/qmlprofiler/qml/magnifier.png deleted file mode 100644 index 0ffafb84f53afddd39bda94070e11cef033d3bc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s77>k44ofy`glX=O&z`&N| z?e4N<#NzbRi5qzj8}P97zlyEo>0Nki@3)H_??N+G-!5XbbLCO)6ODG5#jvwW;luw2 z!gaG!BUv~un9VN`uc~}Mu|;Li_nfrklbWh~CkF*_JWNQMe`#smjG3|}?{3fA#b)T{ zrMbLTvsL2p-q$9+Ok38yuB$&6xmPIG|4tP1f@@tf6Vt9lt+%Q+I{*3K_ltaSvZf#A eMj!eAk>TbO{|+muNvRAB3=E#GelF{r5}E-2aA*wx diff --git a/src/plugins/qmlprofiler/qml/next.png b/src/plugins/qmlprofiler/qml/next.png deleted file mode 100644 index 7700d6fce6ba1d328b435fb7117cd63fb760cca0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 908 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}Ea{HEjtmUfZd~z?Fk)a} zkSuYHC<)F_D=AMbN@Z|N$xljE@XSq2PYp^9M+SPTvAP8X2(@GcZ26ILS*g)jPcZ03GaKu}AbvOhR7dWK3;R@4BcBBI z_!>|0nq@gFdBs%j%s%C1OZY#2y=!8?G`E^fXi;Oo^_`i;b^EK&{hxDKl)-53#Q#iM zy_3FW-Yt0y;gvguFG+83J+%uD`Nm9%|^bJ*#$P|mwd;)_&Qs@dOb-Q}~uOm^FC zL+5)QE4Xj?IApSX&=TAxQ_5+|SUiVYpVuLf;X{gYz*@b9Y7?q&u)db#(qZI!&Zs)2 z!nf1Y-{gDgz^n3%og&JP<3Rt)Q@AS79O2-eJ$OmKX6Y^G@t%Z{ams2?;Pbn%n#?bd>4%Sz#e10sdj4E z!Jp2Pri$vy&SYO|e^`Nef6`fAX-9qYMekT0#2?zW?EZRqxyXZb!_D2EY3DK$14VCh z^Eyl1IIjMzWCw@5%Aa+0JJgvrA5*>7Q!X)MQ~bG5(W5&J&#aW-VQ=Hyznm@HzDMq( zh1^*Nx628-A??-bAMP$X=)R|MHMhv|-Ea7P4z~qleqmduGC@G`b>7k++ud`gPI9fA z^p-cq)8Tf&Hg?Y+78a8@16o&e{V@1EbLyE(`~SrmI3`uy>-o2H`epf#0nv3rQBPbM Q7#J8lUHx3vIVCg!0KlAuApigX diff --git a/src/plugins/qmlprofiler/qml/popup_green.png b/src/plugins/qmlprofiler/qml/popup_green.png deleted file mode 100644 index 38028e943246f346896bd35f2b2985f4958c9b05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1538 zcmeAS@N?(olHy`uVBq!ia0y~yV9)?z4mJh`hMs>rav2yHI14-?iy0WWg+Z8+Vb&Z8 z1_stGo-U3d5u9&lc>BbpiX4A`r_ym@Nx}l2T8{%}n(wBl%@Qit>rwN4duT8BcD>m< z419ZXT$UsyEm|ohUzm8sO<3M#ZKhI$Zoo>{5U$n$jeaAC_J^j2W6r-%KKI3F!4^R_ zv3XCPQ6L+o)XnT0$*fYjs!sS7yFV1}N z<$A5{UfuM#j5iaw8NHXqzMjIx)BUt9L{+0VN`K$oh~UVr`!Bx#ZXXj9CB)O}TvvY} z|K}gO;*E2*FI03gnz%*Cn=`wr$VzbTjF?&7=SypUzcl|UKmYFweaQsPx15?+MK5Wr znjmRlc`>hI{YtZ-o&TMlBplJ}e)DzRnO!nJ``JGHIQ#L+jSFXw&fk|``>%KUtn;TQ zaA(F(5n>l9Wjy0xbd>GWSO0r8N+No8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`MYve zYC7d&!JQLg^#naHYACX}OuD}3{8Vnsl;!Ggp1i+)>a()F8lSAKZNba_pOK7ux)p2= zeeUa@oN+y5t;PR-Rns2-+`8vam(Ra_`}W7Al<4^NYhKo^%E)T%TKr1-ke29~BE|5Y zyFWC`p1n$W(>-yfWZh#W_7bJ(kKQ?~>rfDkvgL2*c%Xj>D@l-3g}aRv)ZTDHiy`-$U%&b?zscIv;vfKZ?vOtmmKq`L}-m;r{~0m+$lZ z75@<|eo9!Qp<|DrzAI~y{)GRrje4R>*~*T*Qx|2qwp&?IdfxJdTc$ng7E2EN6cJ={ zm)S<-24E3x(iVvLL`@An-DdJ53mU#aq6QiH6eBU?A%3#*ppu9QDWH@r& zuC4J(kc(scQGMVwLp|pU?gQEdUaD&A%qH9{=-BC-@XjOkomcw5m;*Mep3f;ZVfZ2F zc__D$)xzzq@&mR5@yv0|6{crhf5p8%zGnKgBzCDH@nUBVwZ{^l9T?NqFIhYYpQx~% zHSOWkhVL=SX789Cw9Ff-qAYzUyzqU#hGi4eytX$b-VCqB!wQY}w5w+YTrw7zaOzF- z?#1`LwOM|pay)q4Y=1xRimLA?hHGD$wJtPqNdz(~uborI!E;jhL*FfDMNRjW7XlXj zJ=grA@m)ZSgpiuYjDlO%%V*3{`uncwfVd2aCjQixb7`IU?M%h2DGld5Z9JBR_CMSt z6g)wq`H04;yx!!E7Wd@J8)g;8=}mgL(2#k^#?(ZRvuG(C2~t}=cEg67ytg5 zlB>-4Z_4r$^9ok72<@?MxMDFcG$(wIOOoy;(VOdDR5x-9KE2=b@8|T(^MiYmxp|XH SjxsPXFnGH9xvXDetail.qml Label.qml MainView.qml - popup_green.png - popup_orange.png RangeDetails.qml RangeMover.qml TimeDisplay.qml clean_pane_small.png - prev.png - next.png recordOff.png recordOn.png StatusDisplay.qml @@ -19,13 +15,17 @@ TimeMarks.qml Overview.qml Overview.js - range.png - range_pressed.png SelectionRange.qml SelectionRangeDetails.qml - magnifier.png arrow_down.png arrow_right.png - arrow_select.png + dialog_shadow.png + range_handle.png + ico_selectionmode.png + ico_zoom.png + ico_prev.png + ico_next.png + ico_rangeselection.png + ico_rangeselected.png diff --git a/src/plugins/qmlprofiler/qml/range.png b/src/plugins/qmlprofiler/qml/range.png deleted file mode 100644 index 756318d556aef8690669b0abdcad1944a1244bd5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s77>k44ofy`glX=O&z`&N| z?e4mdKI;Vst0KB?qO#lD@ diff --git a/src/plugins/qmlprofiler/qml/range_handle.png b/src/plugins/qmlprofiler/qml/range_handle.png new file mode 100644 index 0000000000000000000000000000000000000000..f44fb3337ff000127e73c0a71d9692714b2d234e GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0y~yU|?ZjVBln7W?*1=?l@sG0|NtNage(c!@6@aFF`T| z9+AZi4BWyX%*Zfnjsyb(1AB?5uPgg)ZZQFQ^ZS0~{}~tk44ofy`glX=O&z`&N| z?e4Zw3a2 zE>9Q75R21mgB|$}C~&Oq*8e!Ow&DDn@Efk;$EV~Js<<5WVq|1EqwU!|IjuT_jlolV z!;~fun{Nk}0=vxHxI=M9y+8*U5A zOe~+IurnpD?(v$LVZ77QkDYsUe(SYzJ}C>|w1@xw?vzcq?~@R6Mp(k4Gg*JDZUF-W O1B0ilpUXO@geCy9iCz@| diff --git a/src/plugins/qmlprofiler/qml/recordOff.png b/src/plugins/qmlprofiler/qml/recordOff.png index 66f4e3b36b18d09d60f29585486251b9d1b9a9ee..d50c0183c099fa059bd2afa471a7dac850a117a1 100644 GIT binary patch delta 418 zcmX@h@_~7Rq$o231A~Sxe=q|B17mTJyA#8@b22X{I>>W!iwVf_lBmMvR$ z@7}#{-@a?tu4x=e@&kFIB*-tA!Qt7BGzJES6`n4RArhB!&)*blQV?iJWMvcCn6usW z>{8dmMW6oO*S#=p_P*2q&ooLNm;5sA^VRP&7is-oX4n7f-Oa0kc49ta{pWV+cQ0H} zU3zKP)!fzRudwyp^}c+k=h-Qv;DAY6G)}M5>gI8h=HUJAnI*IAKpQ7l(Y9M_o}X&& zzopr0CFn4d;kCd delta 512 zcmeyse3oT`q&gb|1B3kM|A`C?42;D=?oJHr&dI!FU|?WN@^*J&c+a58psDtfuV|v4 zJSRIVzph|`Xt>|RF!g%I6`n4RAr`0CPPRS$%0ZxYelM5dw`Cn>LbFAF2_I2vo%YW^ zdbS8x(^fN07o9&$$;uLwJ$$~2C3#%gzMJ{wteli)K35SpZX6f zY|{4M7j9F$nl&|T^UR~4TpkJA%=EdDx4mR{EYD$w%O*_<4=QXnMXk-)S|7#Jez-?P zxj@EUPmFurb?v=z{Y5`lTRgHzvzwnR!Pb0`;q<1KN&XS*ug_TKDbaQ(&%EaT`Mmqz zI~Q?WHi^`mepJ$;PkH%eO@^*T1-tLY{q1~oX2}$dt|oz|j}<+ycNwj|{Mn{OAVyC- zYikr+-Tff1B~w@&8w8pTKMc6zB;s1np=cr3|6-Tl%8*~H6nulvJvU}Zln~<#34Qvp zLcmpU`DISu%PT^(G`gCmOtR?XJUrp~XU>LYnXXM$d(Y)+jZ1F7t@FOQE%%{CAIps# zGe-`^x^)*#e68l5+b;CEi)F^yw2FD|BCab|b*+2-rE2e+jq~dtiU;2Nbl`v5e+J7C XhOJf6=gk-x7#KWV{an^LB{Ts5UB%{t diff --git a/src/plugins/qmlprofiler/qml/recordOn.png b/src/plugins/qmlprofiler/qml/recordOn.png index 5d4b77f0f26688edad425ea1cd16e91c9dd7347e..ed5e8912c3d4d4e051bffab1cb7750271e9b5b90 100644 GIT binary patch delta 23 fcmeyt@{DDI;Y4Q{PHr&)d4-s{pDZ?J2rvNvUZe+K delta 39 vcmaFH@`Gi9AwOG^x4R3&dj?GgO|_SNMHBVpIoVnHbqrL~%K|rs2`~Ww=I08J diff --git a/src/plugins/qmlprofiler/timelineview.cpp b/src/plugins/qmlprofiler/timelineview.cpp index 3d1550032dc..fb5a43ba47c 100644 --- a/src/plugins/qmlprofiler/timelineview.cpp +++ b/src/plugins/qmlprofiler/timelineview.cpp @@ -84,8 +84,9 @@ void TimelineView::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget m_spacing = qreal(width()) / windowDuration; m_rowWidths.clear(); + // The "1+" is because the reference screenshot features an empty row per type, in order to leave space for the title for (int i=0; iuniqueEventsOfType(i) : m_eventList->maxNestingForType(i)); + m_rowWidths << 1 + (m_rowsExpanded[i] ? m_eventList->uniqueEventsOfType(i) : m_eventList->maxNestingForType(i)); } // event rows @@ -120,19 +121,6 @@ QColor TimelineView::colorForItem(int itemIndex) return QColor::fromHsl((ndx*25)%360, 76, 166); } -QLinearGradient *TimelineView::gradientForItem(int itemIndex) -{ - int ndx = m_eventList->getEventId(itemIndex); - if (!m_hashedGradients.contains(ndx)) { - QLinearGradient *linearGrad = new QLinearGradient(0,0,0,DefaultRowHeight); - linearGrad->setColorAt(0, colorForItem(itemIndex)); - linearGrad->setColorAt(0.5, colorForItem(itemIndex).darker(115)); - linearGrad->setColorAt(1, colorForItem(itemIndex)); - m_hashedGradients[ndx] = linearGrad; - } - return m_hashedGradients[ndx]; -} - void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex) { int x,y,width,rowNumber, eventType; @@ -140,9 +128,9 @@ void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex) x = (m_eventList->getStartTime(i) - m_startTime) * m_spacing; eventType = m_eventList->getType(i); if (m_rowsExpanded[eventType]) - y = m_rowStarts[eventType] + DefaultRowHeight*m_eventList->eventPosInType(i); + y = m_rowStarts[eventType] + DefaultRowHeight*(m_eventList->eventPosInType(i) + 1); else - y = m_rowStarts[eventType] + DefaultRowHeight*(m_eventList->getNestingLevel(i)-1); + y = m_rowStarts[eventType] + DefaultRowHeight*m_eventList->getNestingLevel(i); width = m_eventList->getDuration(i)*m_spacing; if (width<1) @@ -153,7 +141,7 @@ void TimelineView::drawItemsToPainter(QPainter *p, int fromIndex, int toIndex) continue; m_rowLastX[rowNumber] = x+width; - p->setBrush(*gradientForItem(i)); + p->setBrush(colorForItem(i)); p->drawRect(x,y,width,DefaultRowHeight); } } @@ -168,8 +156,11 @@ void TimelineView::drawSelectionBoxes(QPainter *p) int id = m_eventList->getEventId(m_selectedItem); p->setBrush(Qt::transparent); - QPen strongPen(QBrush(Qt::blue), 3); - QPen lightPen(QBrush(QColor(Qt::blue).lighter(130)), 2); + QColor selectionColor = Qt::blue; + if (m_selectionLocked) + selectionColor = QColor(96,0,255); + QPen strongPen(selectionColor, 3); + QPen lightPen(QBrush(selectionColor.lighter(130)), 2); p->setPen(lightPen); int x, y, width, eventType; @@ -185,9 +176,9 @@ void TimelineView::drawSelectionBoxes(QPainter *p) x = (m_eventList->getStartTime(i) - m_startTime) * m_spacing; eventType = m_eventList->getType(i); if (m_rowsExpanded[eventType]) - y = m_rowStarts[eventType] + DefaultRowHeight*m_eventList->eventPosInType(i); + y = m_rowStarts[eventType] + DefaultRowHeight*(m_eventList->eventPosInType(i) + 1); else - y = m_rowStarts[eventType] + DefaultRowHeight*(m_eventList->getNestingLevel(i)-1); + y = m_rowStarts[eventType] + DefaultRowHeight*m_eventList->getNestingLevel(i); width = m_eventList->getDuration(i)*m_spacing; if (width<1) @@ -271,9 +262,9 @@ void TimelineView::manageHovered(int x, int y) eventType = m_eventList->getType(i); if (m_rowsExpanded[eventType]) - itemRow = m_rowStarts[eventType]/DefaultRowHeight + m_eventList->eventPosInType(i); + itemRow = m_rowStarts[eventType]/DefaultRowHeight + m_eventList->eventPosInType(i) + 1; else - itemRow = m_rowStarts[eventType]/DefaultRowHeight + m_eventList->getNestingLevel(i)-1; + itemRow = m_rowStarts[eventType]/DefaultRowHeight + m_eventList->getNestingLevel(i); if (itemRow == row) { // match m_currentSelection.eventIndex = i; @@ -341,7 +332,7 @@ int TimelineView::nextItemFromId(int eventId) const do { if (m_eventList->getEventId(ndx) == eventId) return ndx; - ndx = (ndx+1) % m_eventList->count(); + ndx = (ndx + 1) % m_eventList->count(); } while (ndx != startIndex); return -1; } @@ -360,7 +351,7 @@ void TimelineView::selectNext() if (m_selectionLocked && m_selectedItem !=-1 ) { // find next item with same eventId int eventId = m_eventList->getEventId(m_selectedItem); - int i = m_selectedItem+1; + int i = m_selectedItem + 1; while (icount() && m_eventList->getEventId(i) != eventId) i++; if (i == m_eventList->count()) { @@ -371,7 +362,7 @@ void TimelineView::selectNext() setSelectedItem(i); } else { // select next in view or after - int newIndex = m_selectedItem+1; + int newIndex = m_selectedItem + 1; if (newIndex >= m_eventList->count()) newIndex = 0; if (m_eventList->getEndTime(newIndex) < m_startTime) diff --git a/src/plugins/qmlprofiler/timelineview.h b/src/plugins/qmlprofiler/timelineview.h index c71d7de8c50..1fbddb1c0c4 100644 --- a/src/plugins/qmlprofiler/timelineview.h +++ b/src/plugins/qmlprofiler/timelineview.h @@ -138,6 +138,7 @@ public slots: { if (m_selectionLocked != locked) { m_selectionLocked = locked; + update(); emit selectionLockedChanged(locked); } } @@ -177,7 +178,6 @@ protected: private: QColor colorForItem(int itemIndex); - QLinearGradient *gradientForItem(int itemIndex); void drawItemsToPainter(QPainter *p, int fromIndex, int toIndex); void drawSelectionBoxes(QPainter *p); @@ -192,7 +192,6 @@ private: qint64 m_lastEndTime; QmlJsDebugClient::QmlProfilerEventList *m_eventList; - QHash m_hashedGradients; QList m_rowLastX; QList m_rowStarts; diff --git a/src/plugins/qmlprofiler/tracewindow.cpp b/src/plugins/qmlprofiler/tracewindow.cpp index 245a25bd0d6..2fd3b4986f2 100644 --- a/src/plugins/qmlprofiler/tracewindow.cpp +++ b/src/plugins/qmlprofiler/tracewindow.cpp @@ -66,6 +66,25 @@ void ZoomControl::setRange(qint64 startTime, qint64 endTime) } } +ScrollableDeclarativeView::ScrollableDeclarativeView(QWidget *parent) + : QDeclarativeView(parent) +{ +} + +ScrollableDeclarativeView::~ScrollableDeclarativeView() +{ +} + +void ScrollableDeclarativeView::scrollContentsBy(int dx, int dy) +{ + // special workaround to track the scrollbar + if (rootObject()) { + int scrollY = rootObject()->property("scrollY").toInt(); + rootObject()->setProperty("scrollY", QVariant(scrollY - dy)); + } + QDeclarativeView::scrollContentsBy(dx,dy); +} + TraceWindow::TraceWindow(QWidget *parent) : QWidget(parent) { @@ -78,7 +97,7 @@ TraceWindow::TraceWindow(QWidget *parent) groupLayout->setContentsMargins(0, 0, 0, 0); groupLayout->setSpacing(0); - m_mainView = new QDeclarativeView(this); + m_mainView = new ScrollableDeclarativeView(this); m_mainView->setResizeMode(QDeclarativeView::SizeViewToRootObject); m_mainView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_mainView->setBackgroundBrush(QBrush(Qt::white)); @@ -147,19 +166,19 @@ QWidget *TraceWindow::createToolbar() toolBarLayout->setSpacing(0); QToolButton *buttonPrev= new QToolButton; - buttonPrev->setIcon(QIcon(":/qmlprofiler/prev.png")); + buttonPrev->setIcon(QIcon(":/qmlprofiler/ico_prev.png")); buttonPrev->setToolTip(tr("Jump to previous event")); connect(buttonPrev, SIGNAL(clicked()), this, SIGNAL(jumpToPrev())); connect(this, SIGNAL(enableToolbar(bool)), buttonPrev, SLOT(setEnabled(bool))); QToolButton *buttonNext= new QToolButton; - buttonNext->setIcon(QIcon(":/qmlprofiler/next.png")); + buttonNext->setIcon(QIcon(":/qmlprofiler/ico_next.png")); buttonNext->setToolTip(tr("Jump to next event")); connect(buttonNext, SIGNAL(clicked()), this, SIGNAL(jumpToNext())); connect(this, SIGNAL(enableToolbar(bool)), buttonNext, SLOT(setEnabled(bool))); QToolButton *buttonZoomControls = new QToolButton; - buttonZoomControls->setIcon(QIcon(":/qmlprofiler/magnifier.png")); + buttonZoomControls->setIcon(QIcon(":/qmlprofiler/ico_zoom.png")); buttonZoomControls->setToolTip(tr("Show zoom slider")); buttonZoomControls->setCheckable(true); buttonZoomControls->setChecked(false); @@ -167,7 +186,7 @@ QWidget *TraceWindow::createToolbar() connect(this, SIGNAL(enableToolbar(bool)), buttonZoomControls, SLOT(setEnabled(bool))); m_buttonRange = new QToolButton; - m_buttonRange->setIcon(QIcon(":/qmlprofiler/range.png")); + m_buttonRange->setIcon(QIcon(":/qmlprofiler/ico_rangeselection.png")); m_buttonRange->setToolTip(tr("Select range")); m_buttonRange->setCheckable(true); m_buttonRange->setChecked(false); @@ -176,7 +195,7 @@ QWidget *TraceWindow::createToolbar() connect(this, SIGNAL(rangeModeChanged(bool)), m_buttonRange, SLOT(setChecked(bool))); m_buttonLock = new QToolButton; - m_buttonLock->setIcon(QIcon(":/qmlprofiler/arrow_select.png")); + m_buttonLock->setIcon(QIcon(":/qmlprofiler/ico_selectionmode.png")); m_buttonLock->setToolTip(tr("View event information on mouseover")); m_buttonLock->setCheckable(true); m_buttonLock->setChecked(false); @@ -184,11 +203,13 @@ QWidget *TraceWindow::createToolbar() connect(this, SIGNAL(enableToolbar(bool)), m_buttonLock, SLOT(setEnabled(bool))); connect(this, SIGNAL(lockModeChanged(bool)), m_buttonLock, SLOT(setChecked(bool))); - toolBarLayout->addWidget(m_buttonLock); toolBarLayout->addWidget(buttonPrev); toolBarLayout->addWidget(buttonNext); + toolBarLayout->addWidget(new Utils::StyledSeparator()); toolBarLayout->addWidget(buttonZoomControls); + toolBarLayout->addWidget(new Utils::StyledSeparator()); toolBarLayout->addWidget(m_buttonRange); + toolBarLayout->addWidget(m_buttonLock); return bar; } @@ -220,9 +241,6 @@ QWidget *TraceWindow::createZoomToolbar() height: 20px;\ margin: 0px 0px 0px 0px;\ }\ - QSlider::groove:horizontal {\ - position: absolute;\ - }\ QSlider::add-page:horizontal {\ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5a5a5a, stop: 1 #444444);\ border: 1px #313131;\ @@ -343,9 +361,9 @@ void TraceWindow::toggleRangeMode(bool active) bool rangeMode = m_mainView->rootObject()->property("selectionRangeMode").toBool(); if (active != rangeMode) { if (active) - m_buttonRange->setIcon(QIcon(":/qmlprofiler/range_pressed.png")); + m_buttonRange->setIcon(QIcon(":/qmlprofiler/ico_rangeselected.png")); else - m_buttonRange->setIcon(QIcon(":/qmlprofiler/range.png")); + m_buttonRange->setIcon(QIcon(":/qmlprofiler/ico_rangeselection.png")); m_mainView->rootObject()->setProperty("selectionRangeMode", QVariant(active)); } } @@ -354,9 +372,9 @@ void TraceWindow::updateRangeButton() { bool rangeMode = m_mainView->rootObject()->property("selectionRangeMode").toBool(); if (rangeMode) - m_buttonRange->setIcon(QIcon(":/qmlprofiler/range_pressed.png")); + m_buttonRange->setIcon(QIcon(":/qmlprofiler/ico_rangeselected.png")); else - m_buttonRange->setIcon(QIcon(":/qmlprofiler/range.png")); + m_buttonRange->setIcon(QIcon(":/qmlprofiler/ico_rangeselection.png")); emit rangeModeChanged(rangeMode); } diff --git a/src/plugins/qmlprofiler/tracewindow.h b/src/plugins/qmlprofiler/tracewindow.h index 3f9f0c02272..e1e401e4169 100644 --- a/src/plugins/qmlprofiler/tracewindow.h +++ b/src/plugins/qmlprofiler/tracewindow.h @@ -43,10 +43,7 @@ #include #include - -QT_BEGIN_NAMESPACE -class QDeclarativeView; -QT_END_NAMESPACE +#include namespace QmlProfiler { namespace Internal { @@ -80,6 +77,16 @@ private: qint64 m_endTime; }; +class ScrollableDeclarativeView : public QDeclarativeView +{ + Q_OBJECT +public: + explicit ScrollableDeclarativeView(QWidget *parent = 0); + ~ScrollableDeclarativeView(); +protected: + void scrollContentsBy(int dx, int dy); +}; + class TraceWindow : public QWidget { Q_OBJECT @@ -156,7 +163,7 @@ private: QWeakPointer m_v8plugin; QSize m_sizeHint; - QDeclarativeView *m_mainView; + ScrollableDeclarativeView *m_mainView; QDeclarativeView *m_timebar; QDeclarativeView *m_overview; QmlJsDebugClient::QmlProfilerEventList *m_eventList;