QmlProfiler: Make timeline renderer vertically flickable

Introduce a second flickable element to encapsulate the timeline as
well as the labels and move SelectionRangeDetails and SelectionRange
out of that to make them float on top.

Task-number: QTCREATORBUG-10420

Change-Id: Ib4af7dc4b0155b9371c582938f1b4abb3e40cf06
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2013-11-08 12:05:18 +01:00
parent 62b0e85dae
commit d3dd806546

View File

@@ -338,6 +338,13 @@ Rectangle {
} }
} }
Flickable {
id: vertflick
flickableDirection: Flickable.VerticalFlick
width: parent.width
height: root.height
clip: true
contentHeight: labels.height
// ***** child items // ***** child items
TimeMarks { TimeMarks {
@@ -354,9 +361,8 @@ Rectangle {
anchors.topMargin: labels.y anchors.topMargin: labels.y
anchors.right: parent.right anchors.right: parent.right
anchors.left: labels.right anchors.left: labels.right
height: root.height contentWidth: 0
contentWidth: 0; height: labels.height + labelsTail.height
contentHeight: labels.height
flickableDirection: Flickable.HorizontalFlick flickableDirection: Flickable.HorizontalFlick
onContentXChanged: { onContentXChanged: {
@@ -392,7 +398,7 @@ Rectangle {
SelectionRange { SelectionRange {
id: selectionRange id: selectionRange
visible: root.selectionRangeMode visible: root.selectionRangeMode
height: root.height height: parent.height
z: 2 z: 2
} }
@@ -403,7 +409,7 @@ Rectangle {
x: flick.contentX x: flick.contentX
width: flick.width width: flick.width
height: root.height height: parent.height
property real startX: 0 property real startX: 0
@@ -477,7 +483,7 @@ Rectangle {
id: selectionRangeControl id: selectionRangeControl
enabled: false enabled: false
width: flick.width width: flick.width
height: root.height height: flick.height
x: flick.contentX x: flick.contentX
hoverEnabled: enabled hoverEnabled: enabled
z: 2 z: 2
@@ -494,19 +500,6 @@ Rectangle {
} }
} }
SelectionRangeDetails {
id: selectionRangeDetails
visible: root.selectionRangeMode
startTime: selectionRange.startTimeString
duration: selectionRange.durationString
endTime: selectionRange.endTimeString
showDuration: selectionRange.width > 1
}
RangeDetails {
id: rangeDetails
}
Rectangle { Rectangle {
id: labels id: labels
width: 150 width: 150
@@ -527,7 +520,7 @@ Rectangle {
Rectangle { Rectangle {
id: labelsTail id: labelsTail
anchors.top: labels.bottom anchors.top: labels.bottom
anchors.bottom: root.bottom height: Math.max(0, vertflick.height - labels.height)
width: labels.width width: labels.width
color: labels.color color: labels.color
} }
@@ -535,9 +528,9 @@ Rectangle {
// Gradient borders // Gradient borders
Item { Item {
anchors.left: labels.right anchors.left: labels.right
anchors.top: labels.top
anchors.bottom: labelsTail.bottom
width: 6 width: 6
anchors.top: root.top
anchors.bottom: root.bottom
Rectangle { Rectangle {
x: parent.width x: parent.width
transformOrigin: Item.TopLeft transformOrigin: Item.TopLeft
@@ -550,6 +543,20 @@ Rectangle {
} }
} }
} }
}
SelectionRangeDetails {
id: selectionRangeDetails
visible: root.selectionRangeMode
startTime: selectionRange.startTimeString
duration: selectionRange.durationString
endTime: selectionRange.endTimeString
showDuration: selectionRange.width > 1
}
RangeDetails {
id: rangeDetails
}
Item { Item {
anchors.right: root.right anchors.right: root.right