From dec0f1a1ba2c64536a982b04a148d8b841aec03a Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Tue, 29 Dec 2015 10:05:23 +0200 Subject: Added BusyIndicator when demos are loading Change-Id: I18736e93262774051b02e5b33bdc1ce3b6adfa83 Task-Id: QTRD-3772 Reviewed-by: Teemu Holappa --- qml/BusyIndicator.qml | 33 +++++++++++++++++++++++++++++++++ qml/Main.qml | 23 +++++++++++++++-------- qml/images/spinner.png | Bin 0 -> 11738 bytes resources.qrc | 2 ++ startup.pro | 3 ++- 5 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 qml/BusyIndicator.qml create mode 100644 qml/images/spinner.png diff --git a/qml/BusyIndicator.qml b/qml/BusyIndicator.qml new file mode 100644 index 0000000..ba0c339 --- /dev/null +++ b/qml/BusyIndicator.qml @@ -0,0 +1,33 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://www.qt.io +** +** This file is part of Qt Enterprise Embedded. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://www.qt.io +** +****************************************************************************/ +import QtQuick 2.4 + +Image { + height: width + source: "images/spinner.png" + sourceSize.width: Math.min(127, width) + sourceSize.height: Math.min(127, height) + + RotationAnimator on rotation { + duration: 800 + loops: Animation.Infinite + from: 0 + to: 360 + running: visible + } +} diff --git a/qml/Main.qml b/qml/Main.qml index ce7fef7..5b1db16 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -20,7 +20,6 @@ import QtQuick.Window 2.2 import QtQuick.Enterprise.VirtualKeyboard 1.2 import com.qtcompany.B2QtLauncher 1.0 - Window { id: window @@ -260,25 +259,33 @@ Window { Item { id: splashScreen visible: opacity > 0 - anchors.fill: parent + BusyIndicator { + id: busyIndicator + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: splashLabel.top + anchors.bottomMargin: height * .5 + width: parent.width * .1 + } + Text { id: splashLabel - color: "white" - text: "Loading..." - anchors.centerIn: parent; - anchors.verticalCenterOffset: -height - font.pixelSize: engine.titleFontSize() + color: "black" + text: qsTr("Loading %1...").arg(engine.applicationName.slice(0, -1)) + anchors.bottom: codeLessImage.top + anchors.bottomMargin: font.pixelSize + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: engine.fontSize() * 1.2 } Image { + id: codeLessImage source: "images/codeless.png" anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom; anchors.margins: parent.height * 0.1; } - } Item { diff --git a/qml/images/spinner.png b/qml/images/spinner.png new file mode 100644 index 0000000..f64144a Binary files /dev/null and b/qml/images/spinner.png differ diff --git a/resources.qrc b/resources.qrc index 99ec1a6..e0bf1f8 100644 --- a/resources.qrc +++ b/resources.qrc @@ -17,5 +17,7 @@ qml/images/Play_btn.png qml/images/close-button.png qml/images/settings.png + qml/BusyIndicator.qml + qml/images/spinner.png diff --git a/startup.pro b/startup.pro index 283db2a..4e73fcf 100644 --- a/startup.pro +++ b/startup.pro @@ -27,7 +27,8 @@ OTHER_FILES += \ qml/Main.qml \ qml/ApplicationIcon.qml \ qml/GlimmeringQtLogo.qml \ - qml/BootScreen.qml + qml/BootScreen.qml \ + qml/BusyIndicator.qml android { target.path = $$[INSTALL_ROOT]/system/bin -- cgit v1.2.3