forked from qt-creator/qt-creator
QmlProfiler: Fix timeline range selection
The timeline did not jump back to the selection when the selection range detail window was clicked and an error was triggered when it was closed. Change-Id: I2de5788a184f2958a07ad39a3a0f298667d9783f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -101,7 +101,6 @@ Rectangle {
|
||||
view.clearData();
|
||||
rangeDetails.hide();
|
||||
selectionRangeMode = false;
|
||||
buttonsBar.updateRangeButton(selectionRangeMode);
|
||||
zoomSlider.externalUpdate = true;
|
||||
zoomSlider.value = zoomSlider.minimumValue;
|
||||
overview.clear();
|
||||
|
||||
@@ -36,11 +36,13 @@ RangeMover {
|
||||
property bool ready: visible && creationState === 3
|
||||
|
||||
property string startTimeString: detailedPrintTime(startTime)
|
||||
property string endTimeString: detailedPrintTime(startTime+duration)
|
||||
property string endTimeString: detailedPrintTime(endTime)
|
||||
property string durationString: detailedPrintTime(duration)
|
||||
|
||||
property double startTime: rangeLeft * viewTimePerPixel + zoomControl.windowStart
|
||||
property double duration: Math.max(rangeWidth * viewTimePerPixel, 500)
|
||||
property double endTime: startTime + duration
|
||||
|
||||
property double viewTimePerPixel: 1
|
||||
property double creationReference : 0
|
||||
property int creationState : 0
|
||||
@@ -59,7 +61,7 @@ RangeMover {
|
||||
}
|
||||
|
||||
onRangeDoubleClicked: {
|
||||
zoomControl.setRange(startTime, startTime + duration);
|
||||
zoomControl.setRange(startTime, endTime);
|
||||
root.selectionRangeMode = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,8 +160,11 @@ Item {
|
||||
drag.minimumY: 0
|
||||
drag.maximumY: root.height - parent.height + 0
|
||||
onClicked: {
|
||||
if ((selectionRange.x < flick.contentX) ^ (selectionRange.x+selectionRange.width > flick.contentX + flick.width)) {
|
||||
root.recenter(selectionRange.startTime + selectionRange.duration/2);
|
||||
if ((selectionRange.startTime < zoomControl.rangeStart) ^
|
||||
(selectionRange.endTime > zoomControl.rangeEnd)) {
|
||||
var center = selectionRange.startTime + selectionRange.duration / 2;
|
||||
var halfDuration = Math.max(selectionRange.duration, zoomControl.rangeDuration / 2);
|
||||
zoomControl.setRange(center - halfDuration, center + halfDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,10 +179,7 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: -8
|
||||
onClicked: {
|
||||
root.selectionRangeMode = false;
|
||||
root.updateRangeButton();
|
||||
}
|
||||
onClicked: root.selectionRangeMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user