Commit 6a7a4588 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

Timeline: Don't add and remove batch roots



Every time a batch root is added or removed the whole scene is rebuilt.
Instead of using the "visible" property we can collapse items to a
height of 0 in order to make them invisible while keeping them in the
scene. This avoids the rebuilds.

Change-Id: Icc6dddb8c8f892a37ef4ed5bced501e5f1658d80
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent b054fd85
......@@ -284,12 +284,12 @@ Rectangle {
Flickable {
flickableDirection: Flickable.HorizontalFlick
clip: true
visible: selectionRangeMode &&
selectionRange.creationState !== selectionRange.creationInactive
interactive: false
x: content.x + content.flickableItem.x
y: content.y + content.flickableItem.y
height: content.flickableItem.height
height: (selectionRangeMode &&
selectionRange.creationState !== selectionRange.creationInactive) ?
content.flickableItem.height : 0
width: content.flickableItem.width
contentX: content.contentX
contentWidth: content.contentWidth
......@@ -297,7 +297,6 @@ Rectangle {
SelectionRange {
id: selectionRange
zoomer: zoomControl
visible: parent.visible
onRangeDoubleClicked: {
var diff = 500 - zoomer.selectionDuration;
......@@ -319,11 +318,12 @@ Rectangle {
clip: true
id: selectionRangeDetails
visible: selectionRange.visible
startTime: zoomControl.selectionStart
duration: zoomControl.selectionDuration
endTime: zoomControl.selectionEnd
showDuration: selectionRange.rangeWidth > 1
hasContents: selectionRangeMode &&
selectionRange.creationState !== selectionRange.creationInactive
onRecenter: {
if ((zoomControl.selectionStart < zoomControl.rangeStart) ^
......@@ -342,7 +342,6 @@ Rectangle {
id: rangeDetails
z: 3
visible: false
x: 200
y: 25
......@@ -350,6 +349,7 @@ Rectangle {
locked: content.selectionLocked
models: timelineModelAggregator.models
notes: timelineModelAggregator.notes
hasContents: false
onRecenterOnItem: {
content.gotoSourceLocation(file, line, column);
content.select(selectedModel, selectedItem)
......
......@@ -40,6 +40,7 @@ Item {
property int line
property int column
property bool isBindingLoop
property bool hasContents
property int selectedModel: -1
property int selectedItem: -1
......@@ -54,11 +55,11 @@ Item {
signal clearSelection
width: col.width + 25
height: contentArea.height + titleBar.height
height: hasContents ? contentArea.height + titleBar.height : 0
function hide() {
noteEdit.focus = false;
visible = false;
hasContents = false;
selectedModel = selectedItem = -1;
noteEdit.text = "";
duration = "";
......@@ -97,7 +98,7 @@ Item {
eventInfo.append({content : eventData[k]});
}
}
rangeDetails.visible = true;
hasContents = true;
var location = timelineModel.location(selectedItem)
if (location.hasOwnProperty("file")) { // not empty
......
......@@ -40,9 +40,10 @@ Item {
property string endTime
property string duration
property bool showDuration
property bool hasContents
width: Math.max(150, col.width + 25)
height: col.height + 30
height: hasContents ? col.height + 30 : 0
// keep inside view
Connections {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment