Files
qt-creator/share/qtcreator/qmldesigner/welcomepage/DownloadProgressBar.qml
Thomas Hartmann b47e074f62 QmlDesigner: Add QML source
This adds the QML source for the Qt Design Studio Welcome page.
The source code was private before.

Change-Id: I5dcb900ed9a17b1bc3bbcaf50f649ebeb61cc8bf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-01-17 09:46:02 +00:00

81 lines
2.2 KiB
QML

// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick
import QtQuick.Controls
import WelcomeScreen 1.0
import StudioTheme as StudioTheme
Item {
id: progressBar
width: 272
height: 25
property bool downloadFinished: false
property int value: 0
property bool closeButtonVisible
//property alias numberAnimationRunning: numberAnimation.running
readonly property int margin: 4
signal cancelRequested
Rectangle {
id: progressBarGroove
color: Constants.currentNormalThumbnailLabelBackground
anchors.fill: parent
}
Rectangle {
id: progressBarTrack
width: progressBar.value * ((progressBar.width - closeButton.width) - 2 * progressBar.margin) / 100
color: Constants.currentBrand
border.color: "#002e769e"
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: progressBar.margin
}
Text {
id: closeButton
visible: progressBar.closeButtonVisible
width: 20
text: StudioTheme.Constants.closeCross
color: Constants.currentBrand
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
font.family: StudioTheme.Constants.iconFont.family
font.pixelSize: StudioTheme.Values.myIconFontSize
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: progressBar.margin
MouseArea {
anchors.fill: parent
onClicked: {
progressBar.cancelRequested()
}
}
}
/*
NumberAnimation {
id: numberAnimation
target: progressBarTrack
property: "width"
duration: 2500
easing.bezierCurve: [0.197,0.543,0.348,0.279,0.417,0.562,0.437,0.757,0.548,0.731,0.616,0.748,0.728,0.789,0.735,0.982,1,1]
alwaysRunToEnd: true
to: progressBar.width
from: 0
}
Connections {
target: numberAnimation
onFinished: progressBar.downloadFinished = true
}
*/
}