1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import QtQuick.Controls
Window {
id: rootWindow
readonly property url startupView: "StartupView.qml"
width: 1280
height: 720
visible: true
title: qsTr("Qt Quick 3D Particles3D Testbed")
color: "#000000"
Component.onCompleted: {
AppSettings.iconSize = Qt.binding(function() {
return 16 + Math.max(rootWindow.width, rootWindow.height) * 0.05
})
}
Loader {
id: loader
anchors.fill: parent
Component.onCompleted: setSource(rootWindow.startupView, {loader: loader})
}
Button {
id: backButton
anchors.left: parent.left
anchors.top: parent.top
implicitWidth: AppSettings.iconSize
implicitHeight: AppSettings.iconSize
//height: width
opacity: loader.source !== rootWindow.startupView
visible: opacity
icon.source: "qrc:/images/arrow_icon.png"
icon.width: backButton.width * 0.3
icon.height: backButton.height * 0.3
icon.color: "transparent"
background: Rectangle {
color: "transparent"
}
onClicked: {
loader.setSource(rootWindow.startupView, {loader: loader})
}
Behavior on opacity {
NumberAnimation {
duration: 400
easing.type: Easing.InOutQuad
}
}
}
}
|