diff --git a/src/libs/timeline/qml/CategoryLabel.qml b/src/libs/timeline/qml/CategoryLabel.qml index ecb2cbab591..e6dd396547a 100644 --- a/src/libs/timeline/qml/CategoryLabel.qml +++ b/src/libs/timeline/qml/CategoryLabel.qml @@ -42,6 +42,7 @@ Item { property int visualIndex property int dragOffset property Item draggerParent + property int contentBottom: draggerParent.contentY + draggerParent.height - dragOffset signal dragStarted; signal dragStopped; @@ -101,12 +102,14 @@ Item { visible: expanded Repeater { model: expanded ? labels.length : 0 - SynchronousReloader { + Loader { id: loader - asynchronous: dragOffset - draggerParent.contentY + y + txt.height > - draggerParent.height - active: expanded + // Initially y == 0 for all the items. Don't enable them until they have been moved + // into place. + property int offset: (index === 0 || y > 0) ? (y + txt.height) + : draggerParent.contentHeight + active: contentBottom > offset width: labelContainer.width height: column.parentModel ? column.parentModel.rowHeight(index + 1) : 0 diff --git a/src/libs/timeline/qml/SynchronousReloader.qml b/src/libs/timeline/qml/SynchronousReloader.qml deleted file mode 100644 index a53f829ba02..00000000000 --- a/src/libs/timeline/qml/SynchronousReloader.qml +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -import QtQuick 2.0 - -Loader { - onAsynchronousChanged: { - if (!asynchronous && active && status !== Loader.Ready) { - // Trigger a synchronous reload to avoid glitches - var component = sourceComponent; - sourceComponent = undefined; - sourceComponent = component; - } - } -} - diff --git a/src/libs/timeline/qml/TimelineLabels.qml b/src/libs/timeline/qml/TimelineLabels.qml index 95b82f7d854..71434822f4b 100644 --- a/src/libs/timeline/qml/TimelineLabels.qml +++ b/src/libs/timeline/qml/TimelineLabels.qml @@ -71,7 +71,7 @@ Flickable { } model: modelProxy.models - delegate: SynchronousReloader { + delegate: Loader { id: loader asynchronous: y < categories.contentY + categories.height && y + height > categories.contentY diff --git a/src/libs/timeline/qml/timeline.qrc b/src/libs/timeline/qml/timeline.qrc index 18a1933c6f6..ca6493ba5c4 100644 --- a/src/libs/timeline/qml/timeline.qrc +++ b/src/libs/timeline/qml/timeline.qrc @@ -27,7 +27,6 @@ TimelineLabels.qml TimelineContent.qml RowLabel.qml - SynchronousReloader.qml TimelineText.qml ImageToolButton.qml TimelineRulers.qml