From 25842566eee73aa8f2b07dcd334d47d6f6853579 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 20 Oct 2020 12:06:53 +0300 Subject: startupscreen: make UI dynamic Dynamically adjust the UI element based on the screen size to better handle the various screen sizes available in embedded devices. Make states handle only the landscape - portrait changes. Remove progress bar from splash screen and make it hide automoatically. Remove SD card button and hide wifi button. Change-Id: I308ad696cf4c2ee3b97adfc231cd76899152f357 Reviewed-by: Assam Boudjelthia Reviewed-by: Rami Potinkara --- startupscreen/AnalogClock.qml | 4 +- startupscreen/MainView.qml | 524 ++++------------------ startupscreen/SDcardButton.qml | 203 --------- startupscreen/SplashView.ui.qml | 29 +- startupscreen/StartupScreen.qml | 80 ++-- startupscreen/TextButton.qml | 4 +- startupscreen/UsbButton.qml | 4 +- startupscreen/WifiButton.qml | 4 +- startupscreen/imports/StartupScreen/Constants.qml | 98 ---- startupscreen/imports/StartupScreen/qmldir | 1 - startupscreen/qml.qrc | 3 - 11 files changed, 134 insertions(+), 820 deletions(-) delete mode 100644 startupscreen/SDcardButton.qml delete mode 100644 startupscreen/imports/StartupScreen/Constants.qml delete mode 100644 startupscreen/imports/StartupScreen/qmldir (limited to 'startupscreen') diff --git a/startupscreen/AnalogClock.qml b/startupscreen/AnalogClock.qml index c7d5643..1f725b3 100644 --- a/startupscreen/AnalogClock.qml +++ b/startupscreen/AnalogClock.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 +import QtQuick +import StartupScreen Item { id: clock diff --git a/startupscreen/MainView.qml b/startupscreen/MainView.qml index e4c6522..bed57e4 100644 --- a/startupscreen/MainView.qml +++ b/startupscreen/MainView.qml @@ -48,13 +48,14 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 +import QtQuick +import StartupScreen Item { id: root - width: Constants.smallWidth - height: Constants.smallHeight + + property var textNormal: panel.height / 9 + property var textLarge: panel.height / 7 Image { id: backgroundImage @@ -65,37 +66,35 @@ Item { Item { id: panel anchors.top: root.top - anchors.topMargin: 20 + anchors.topMargin: height / 10 anchors.left: root.left - height: headerBackground.height + bodyBackground.height - width: Constants.smallPanelWidth - + height: width / 2 + width: root.width * 0.6 Item { id: headerBackground - width: parent.width - height: Constants.smallHeaderHeight - + height: parent.height / 3 anchors.top: panel.top anchors.left: panel.left + anchors.right: panel.right Image { id: headerBackgroundRight source: "assets/headerBackgroundRight.png" - fillMode: Image.PreserveAspectFit - height: parent.height + width: height anchors.right: parent.right anchors.top: parent.top + anchors.bottom: parent.bottom } Image { id: headerBackgroundLeft source: "assets/headerBackgroundLeft.png" - height: parent.height - width: parent.width-headerBackgroundRight.width anchors.left: parent.left anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: headerBackgroundRight.left } Text { id: headerText_1 @@ -103,9 +102,8 @@ Item { text: "Get started with" anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - font.pixelSize: 20 + font.pixelSize: textNormal font.family: "Titillium Web" - anchors.topMargin: 8 } Text { id: headerText_2 @@ -114,474 +112,136 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom font.bold: true - font.pixelSize: 48 + font.pixelSize: textLarge font.family: "Titillium Web" - anchors.bottomMargin: 0 } } // body of the text panel Rectangle { id: bodyBackground - height: Constants.smallBodyHeight color: "#000000" - width: headerBackground.width + anchors.right: panel.right + anchors.left: panel.left anchors.top: headerBackground.bottom - anchors.left: headerBackground.left + anchors.bottom: panel.bottom Text { id: bodyText color: "#ffffff" - width: parent.width - 40 text: "How to install demo\napplication from Qt Creator?" - font.pixelSize: 24 + font.pixelSize: textNormal font.family: "Titillium Web" anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top horizontalAlignment: Text.AlignHCenter lineHeight: 0.8 wrapMode: Text.WordWrap - anchors.topMargin: 8 } TextButton { id: textButton - width: parent.width - 40 - height: Constants.smallTextButton - fontSize: 24 + width: parent.width * 0.9 + height: parent.height / 3 + fontSize: textNormal anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: 20 + anchors.bottomMargin: height / 4 } } } - // Button row - UsbButton { - id: usbButton - height: Constants.smallButton - width: height - iconHeight: height-24 - - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.top: panel.bottom - anchors.topMargin: 48 - } - SDcardButton { - id: sdCardButton - height: Constants.smallButton - width: height - iconHeight: height-24 - - - anchors.bottom: usbButton.bottom - anchors.left: usbButton.right - anchors.leftMargin: 50 - } - WifiButton { - id: wifiButton - height: Constants.smallButton - width: height - iconHeight: height-24 - - anchors.bottom: usbButton.bottom - anchors.right: panel.right - } - // Analog clock showing the current time + Item { + id: clockAlignment + anchors.right: root.right + anchors.left: panel.right + anchors.top: panel.top + anchors.bottom: panel.bottom + } AnalogClock { id: clock - width: Constants.smallClock - height: Constants.smallClock - anchors.top: root.top - anchors.topMargin: panel.anchors.topMargin + panel.height / 2 - clock.height / 2 - anchors.right: root.right - anchors.rightMargin: 20 + width: height + height: panel.height * 0.7 + anchors.horizontalCenter: clockAlignment.horizontalCenter + anchors.verticalCenter: panel.verticalCenter + anchors.topMargin: height * 0.1 } - // label and IP address - Item { - id: ipPanel - height: usbButton.height - anchors.horizontalCenter: clock.horizontalCenter - anchors.bottom: usbButton.bottom - Text { - id: ipLabel - color: "#ffffff" - text: "IP address" - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: parent.top - anchors.topMargin: 24 - font.pixelSize: 20 - font.family: "Titillium Web" + // Button row + Row { + id: buttonRow + anchors.top: panel.bottom + anchors.horizontalCenter: panel.horizontalCenter + spacing: buttonSize / 4 + padding: buttonSize / 4 + property var buttonSize: panel.height / 2 + + UsbButton { + id: usbButton + height: parent.buttonSize + width: height + iconHeight: height * 0.9 } - Text { - id: ipAddress - color: "#ffffff" - text: "255.255.255.255" - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - anchors.bottomMargin: 24 - font.pixelSize: 20 - font.bold: true - font.family: "Titillium Web" + WifiButton { + id: wifiButton + height: parent.buttonSize + width: height + iconHeight: height * 0.9 + visible: false } } - // states for different resolutions - // base state = small landscape - states: [ - State { - name: "smallPortrait" - - PropertyChanges { - target: clock - width: Constants.smallClock - height: Constants.smallClock - - anchors.topMargin: 12 - anchors.rightMargin: root.width / 2 - clockRadius - } - PropertyChanges { - target: panel - anchors.topMargin: 204 - } - PropertyChanges { - target: usbButton - anchors.topMargin: 12 - } - PropertyChanges { - target: ipPanel - anchors.bottomMargin: -80 - } - }, - State { - name: "mediumLandscape" - - PropertyChanges { - target: clock - width: Constants.mediumClock - height: Constants.mediumClock - - anchors.topMargin: panel.anchors.topMargin + panel.height / 2 - clock.height / 2 - anchors.rightMargin: 152 + // label and IP address + Text { + id: ipLabel + color: "grey" + text: "Network" + anchors.bottom: ipAddress.top + anchors.horizontalCenter: ipAddress.horizontalCenter + font.pixelSize: textNormal + font.family: "Titillium Web" + } + Text { + id: ipAddress + color: "grey" + text: "eth0: 255.255.255.255\nusb0: 0:0.0.0.0" + anchors.bottom: root.bottom + anchors.right: root.right + anchors.rightMargin: 5 + font.pixelSize: textNormal + font.bold: true + font.family: "Titillium Web" + } - wideDial: 8 - narrowDial: 4 - } - PropertyChanges { - target: panel - anchors.topMargin: 48 - width: Constants.mediumPanelWidth - } - PropertyChanges { - target: headerBackground - height: Constants.mediumHeaderHeight - } - PropertyChanges { - target: bodyBackground - height: Constants.mediumBodyHeight - } - PropertyChanges { - target: headerText_1 - font.pixelSize: 40 - anchors.topMargin: 0 - } - PropertyChanges { - target: headerText_2 - font.pixelSize: 88 - anchors.bottomMargin: -8 - } - PropertyChanges { - target: bodyText - font.pixelSize: 40 - } - PropertyChanges { - target: textButton - height: Constants.mediumTextButton - width: panel.width - 64 - fontSize: 40 - anchors.bottomMargin: 32 - } - PropertyChanges { - target: usbButton - height: Constants.mediumButton - width: height - anchors.topMargin: 54 - anchors.leftMargin: 32 - } - PropertyChanges { - target: sdCardButton - height: Constants.mediumButton - width: height - anchors.leftMargin: 90 - } - PropertyChanges { - target: wifiButton - height: Constants.mediumButton - width: height - } - PropertyChanges { - target: ipPanel - } - PropertyChanges { - target: ipLabel - font.pixelSize: 36 - } - PropertyChanges { - target: ipAddress - font.pixelSize: 36 - } - }, + // base state = landscape + states: [ State { - name: "mediumPortrait" - PropertyChanges { - target: clock - width: Constants.mediumClock - height: Constants.mediumClock - - anchors.topMargin: 60 - anchors.rightMargin: root.width / 2 - clockRadius + name: "portrait" - wideDial: 8 - narrowDial: 4 - } PropertyChanges { target: panel - anchors.topMargin: 440 - width: Constants.mediumPanelWidth - } - PropertyChanges { - target: headerBackground - height: Constants.mediumHeaderHeight - } - PropertyChanges { - target: bodyBackground - height: Constants.mediumBodyHeight - } - PropertyChanges { - target: headerText_1 - font.pixelSize: 40 - anchors.topMargin: 0 - } - PropertyChanges { - target: headerText_2 - font.pixelSize: 88 - anchors.bottomMargin: -8 - } - PropertyChanges { - target: bodyText - font.pixelSize: 40 - } - PropertyChanges { - target: textButton - height: Constants.mediumTextButton - width: panel.width - 64 - fontSize: 40 - anchors.bottomMargin: 32 - } - PropertyChanges { - target: usbButton - height: Constants.mediumButton - width: height - anchors.topMargin: 60 - anchors.leftMargin: 32 - } - PropertyChanges { - target: sdCardButton - height: Constants.mediumButton - width: height - anchors.leftMargin: 90 - } - PropertyChanges { - target: wifiButton - height: Constants.mediumButton - width: height - } - PropertyChanges { - target: ipPanel - anchors.bottomMargin: -200 + width: root.width * 0.9 } - PropertyChanges { - target: ipLabel - font.pixelSize: 36 - } - PropertyChanges { - target: ipAddress - font.pixelSize: 36 - } - }, - State { - name: "largeLandscape" - - PropertyChanges { - target: clock - width: Constants.largeClock - height: Constants.largeClock - - anchors.topMargin: panel.anchors.topMargin + panel.height / 2 - clock.height / 2 - anchors.rightMargin: 152 - - wideDial: 12 - narrowDial: 6 - } - PropertyChanges { + AnchorChanges { target: panel - anchors.topMargin: 48 - width: Constants.largePanelWidth - } - PropertyChanges { - target: headerBackground - height: Constants.largeHeaderHeight - } - PropertyChanges { - target: bodyBackground - height: Constants.largeBodyHeight - } - PropertyChanges { - target: headerText_1 - font.pixelSize: 72 - anchors.topMargin: 0 - } - PropertyChanges { - target: headerText_2 - font.pixelSize: 132 - anchors.bottomMargin: -8 - } - PropertyChanges { - target: bodyText - font.pixelSize: 72 - } - PropertyChanges { - target: textButton - height: Constants.largeTextButton - width: panel.width - 80 - fontSize: 72 - anchors.bottomMargin: 40 - } - PropertyChanges { - target: usbButton - height: Constants.largeButton - width: height - anchors.topMargin: 32 - anchors.leftMargin: 40 - - } - PropertyChanges { - target: sdCardButton - height: Constants.largeButton - width: height - anchors.leftMargin: 188 - } - PropertyChanges { - target: wifiButton - height: Constants.largeButton - width: height - } - PropertyChanges { - target: ipPanel - anchors.bottom: usbButton.bottom - } - PropertyChanges { - target: ipLabel - font.pixelSize: 72 - anchors.topMargin: 0 + anchors.top: clock.bottom } - PropertyChanges { - target: ipAddress - font.pixelSize: 72 - anchors.bottomMargin: 0 - } - }, - State { - name: "largePortrait" - PropertyChanges { + AnchorChanges { target: clock - width: Constants.largeClock - height: Constants.largeClock - - anchors.topMargin: 48 - anchors.rightMargin: root.width / 2 - clockRadius - - wideDial: 12 - narrowDial: 6 - } - PropertyChanges { - target: panel - anchors.topMargin: 640 - width: Constants.largePanelWidth + anchors.top: root.top + anchors.horizontalCenter: root.horizontalCenter + anchors.verticalCenter: undefined } - - PropertyChanges { - target: headerBackground - height: Constants.largeHeaderHeight - } - PropertyChanges { - target: bodyBackground - height: Constants.largeBodyHeight - } - PropertyChanges { - target: headerText_1 - font.pixelSize: 72 - anchors.topMargin: 0 - } - PropertyChanges { - target: headerText_2 - font.pixelSize: 132 - anchors.bottomMargin: -8 - } - PropertyChanges { - target: bodyText - font.pixelSize: 72 - } - PropertyChanges { - target: textButton - height: Constants.largeTextButton - width: panel.width - 80 - fontSize: 72 - anchors.bottomMargin: 40 - } - PropertyChanges { - target: usbButton - height: Constants.largeButton - width: height - anchors.topMargin: 60 - anchors.leftMargin: 40 - } - PropertyChanges { - target: sdCardButton - height: Constants.largeButton - width: height - anchors.leftMargin: 188 - } - PropertyChanges { - target: wifiButton - height: Constants.largeButton - width: height - } - PropertyChanges { - target: ipPanel - anchors.bottomMargin: -240 - } - PropertyChanges { - target: ipLabel - font.pixelSize: 72 - anchors.topMargin: 0 - } - PropertyChanges { - target: ipAddress - font.pixelSize: 72 - anchors.bottomMargin: 0 + AnchorChanges { + target: buttonRow + anchors.horizontalCenter: undefined + anchors.left: root.left } } ] } -/*##^## -Designer { - D{i:0;autoSize:true;height:640;width:480} -} -##^##*/ + diff --git a/startupscreen/SDcardButton.qml b/startupscreen/SDcardButton.qml deleted file mode 100644 index 586d2c6..0000000 --- a/startupscreen/SDcardButton.qml +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Device Creation. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.12 -import StartupScreen 1.0 - -Item { - id: root - - property alias iconHeight: icon.height - - Rectangle { - id: buttonBackground - anchors.fill: parent - color: "#3a4055" - radius: 0 - } - - // changing button state - MouseArea { - anchors.fill: parent - - onPressed: { - root.scale = 0.9 - } - onReleased: { - root.scale = 1.0 - if (root.state == "") - root.state = "working" - else if (root.state == "working") - root.state = "ok" - else - root.state = "" - } - } - - // icon - Image { - id: icon - source: "assets/icon_SDcard.png" - fillMode: Image.PreserveAspectFit - anchors.centerIn: parent - } - - // marker for the error, working and OK states - Image { - id: markerBackground - height: icon.height/2 - - anchors.right: parent.right - anchors.bottom: parent.bottom - source: "assets/icon_markerBackground.png" - anchors.rightMargin: 0 - anchors.bottomMargin: 0 - fillMode: Image.PreserveAspectFit - - Image { - id: errorIcon - height: parent.height*0.5 - anchors.centerIn: parent - source: "assets/icon_error.png" - fillMode: Image.PreserveAspectFit - opacity: 1 - } - Image { - id: workingIcon - height: parent.height*0.75 - anchors.centerIn: parent - source: "assets/icon_working.png" - fillMode: Image.PreserveAspectFit - opacity: 0 - - RotationAnimation on rotation { - from: 0 - to: 360 - loops: Animation.Infinite - duration: 1000 - running: true - } - } - Image { - id: okIcon - height: parent.height *0.5 - anchors.centerIn: parent - source: "assets/icon_ok.png" - fillMode: Image.PreserveAspectFit - opacity: 0 - } - } - states: [ - State { - name: "working" - PropertyChanges { - target: errorIcon - opacity: 0 - } - PropertyChanges { - target: workingIcon - opacity: 1 - } - PropertyChanges { - target: okIcon - opacity: 0 - } - }, - State { - name: "ok" - PropertyChanges { - target: errorIcon - opacity: 0 - } - PropertyChanges { - target: workingIcon - opacity: 0 - } - PropertyChanges { - target: okIcon - opacity: 1 - } - } - ] - transitions: [ - Transition { - from: "" - to: "working" - PropertyAnimation { - duration: 200 - properties: "opacity" - - } - }, - Transition { - from: "working" - to: "ok" - PropertyAnimation { - duration: 200 - properties: "opacity" - } - }, - Transition { - from: "" - to: "working" - PropertyAnimation { - duration: 200 - properties: "opacity" - - } - } - ] -} - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/startupscreen/SplashView.ui.qml b/startupscreen/SplashView.ui.qml index bf12f6f..07b339b 100644 --- a/startupscreen/SplashView.ui.qml +++ b/startupscreen/SplashView.ui.qml @@ -1,3 +1,4 @@ + /**************************************************************************** ** ** Copyright (C) 2020 The Qt Company Ltd. @@ -47,9 +48,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 -import QtQuick.Controls 2.15 +import QtQuick +import QtQuick.Controls Rectangle { id: root @@ -65,29 +65,6 @@ Rectangle { source: "assets/builtwithQt.png" anchors.centerIn: root } - - ProgressBar { - id: progressBar - width: parent.width - height: 8 - value: 0.5 - anchors.bottom: parent.bottom - anchors.left: parent.left - background: Item { - implicitWidth: parent.width - implicitHeight: 6 - } - contentItem: Item { - implicitWidth: parent.width - implicitHeight: 6 - Rectangle { - width: progressBar.visualPosition * parent.width - height: parent.height - color: "#41CD52" - border.width: 0 - } - } - } } /*##^## diff --git a/startupscreen/StartupScreen.qml b/startupscreen/StartupScreen.qml index b4098b7..254dba2 100644 --- a/startupscreen/StartupScreen.qml +++ b/startupscreen/StartupScreen.qml @@ -48,19 +48,26 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.15 -import StartupScreen 1.0 +import QtQuick +import QtQuick.Controls +import StartupScreen ApplicationWindow { id: bootUI visible: true - property bool isPortrait: false // true // - property int resolution: 1 + property bool isPortrait: height > width ? true : false - width: Constants.smallWidth - height: Constants.smallHeight + width: 640 + height: 480 + + Timer { + interval: 1000 + running: true + onTriggered: { + splashAnimator.running = true + } + } // for testing Item { @@ -69,59 +76,34 @@ ApplicationWindow { Keys.onPressed: { // rotate: toggle portrait/landscape if (event.key === Qt.Key_R) { - isPortrait? isPortrait = false: isPortrait = true - } - - // navigate from splash to main - else if (event.key === Qt.Key_Space){ - splash.opacity= 0 - main.opacity=1 - } - - // change window size - else if (event.key === Qt.Key_1) { - resolution = 1 - } - else if (event.key === Qt.Key_2) { - resolution = 2 - } - else if (event.key === Qt.Key_3) { - resolution = 3 - } - - // set width - if (resolution == 1){ - bootUI.width = isPortrait? Constants.smallHeight: Constants.smallWidth - bootUI.height= isPortrait? Constants.smallWidth: Constants.smallHeight - isPortrait? main.state = "smallPortrait": main.state = "" - } - else if (resolution == 2){ - bootUI.width = isPortrait? Constants.mediumHeight: Constants.mediumWidth - bootUI.height = isPortrait? Constants.mediumWidth: Constants.mediumHeight - isPortrait? main.state = "mediumPortrait": main.state = "mediumLandscape" - - } - else{ - bootUI.width = isPortrait? Constants.largeHeight: Constants.largeWidth - bootUI.height = isPortrait? Constants.largeWidth: Constants.largeHeight - isPortrait? main.state = "largePortrait": main.state = "largeLandscape" + var height = bootUI.height + bootUI.height = bootUI.width + bootUI.width = height } } } - SplashView { - id: splash + MainView { + id: main width: bootUI.width height: bootUI.height + state: isPortrait ? "portrait" : "" } - MainView { - id: main + SplashView { + id: splash width: bootUI.width height: bootUI.height - - opacity: 0 + opacity: 1 + OpacityAnimator { + id: splashAnimator + target: splash + from: 1 + to: 0 + duration: 2000 + } } + } diff --git a/startupscreen/TextButton.qml b/startupscreen/TextButton.qml index b96982e..e5f11fc 100644 --- a/startupscreen/TextButton.qml +++ b/startupscreen/TextButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 +import QtQuick +import StartupScreen Rectangle { property alias fontSize: buttonLabel.font.pixelSize diff --git a/startupscreen/UsbButton.qml b/startupscreen/UsbButton.qml index af9482b..9155de8 100644 --- a/startupscreen/UsbButton.qml +++ b/startupscreen/UsbButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 +import QtQuick +import StartupScreen Item { id: root diff --git a/startupscreen/WifiButton.qml b/startupscreen/WifiButton.qml index 1d7f8c0..0f617e5 100644 --- a/startupscreen/WifiButton.qml +++ b/startupscreen/WifiButton.qml @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import StartupScreen 1.0 +import QtQuick +import StartupScreen Item { id: root diff --git a/startupscreen/imports/StartupScreen/Constants.qml b/startupscreen/imports/StartupScreen/Constants.qml deleted file mode 100644 index d9e091f..0000000 --- a/startupscreen/imports/StartupScreen/Constants.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of Qt for Device Creation. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -pragma Singleton -import QtQuick 2.10 -import StartupScreen 1.0 - -QtObject { - // readonly property int width: 640 - // readonly property int height: 480 - - // resolutions - readonly property int smallWidth: 640 - readonly property int smallHeight: 480 - readonly property int mediumWidth: 1280 - readonly property int mediumHeight: 720 - readonly property int largeWidth: 1920 - readonly property int largeHeight: 1080 - - // clock sizes - readonly property int smallClock: 180 - readonly property int mediumClock: 320 - readonly property int largeClock: 540 - - // panel width - readonly property int smallPanelWidth: 420 - readonly property int mediumPanelWidth: 660 - readonly property int largePanelWidth: 1000 - - // header height - readonly property int smallHeaderHeight: 92 - readonly property int mediumHeaderHeight: 160 - readonly property int largeHeaderHeight: 260 - - // body height - readonly property int smallBodyHeight: 172 - readonly property int mediumBodyHeight: 260 - readonly property int largeBodyHeight: 480 - - // icon button sizes - readonly property int smallButton: 100 - readonly property int mediumButton: 148 - readonly property int largeButton: 200 - - // text button sizes - readonly property int smallTextButton: 60 - readonly property int mediumTextButton: 92 - readonly property int largeTextButton: 140 - - readonly property color backgroundColor: "#c2c2c2" -} diff --git a/startupscreen/imports/StartupScreen/qmldir b/startupscreen/imports/StartupScreen/qmldir deleted file mode 100644 index 616ac20..0000000 --- a/startupscreen/imports/StartupScreen/qmldir +++ /dev/null @@ -1 +0,0 @@ -singleton Constants 1.0 Constants.qml diff --git a/startupscreen/qml.qrc b/startupscreen/qml.qrc index 11c09fc..ec4c769 100644 --- a/startupscreen/qml.qrc +++ b/startupscreen/qml.qrc @@ -19,13 +19,10 @@ StartupScreen.qml MainView.qml qtquickcontrols2.conf - SDcardButton.qml SplashView.ui.qml UsbButton.qml WifiButton.qml TextButton.qml - imports/StartupScreen/qmldir - imports/StartupScreen/Constants.qml fonts/TitilliumWeb-Bold.ttf fonts/TitilliumWeb-Light.ttf fonts/TitilliumWeb-Regular.ttf -- cgit v1.2.3