From c99397d75120095e7c91bd674e10c760eba64ad4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 13 Mar 2017 09:24:55 +0100 Subject: Wearable: rename the pages Even the code and the documentation talks about "pages", so call the types pages too. Change-Id: Ie0151be1b2344af6f7122ed22da6cc3b1ea634e4 Reviewed-by: Mitch Curtis --- .../wearable/qml/Alarms/AlarmsMain.qml | 184 ----------- .../wearable/qml/Alarms/AlarmsPage.qml | 184 +++++++++++ .../wearable/qml/Fitness/FitnessMain.qml | 163 ---------- .../wearable/qml/Fitness/FitnessPage.qml | 163 ++++++++++ .../quickcontrols2/wearable/qml/LauncherMain.qml | 222 ------------- .../quickcontrols2/wearable/qml/LauncherPage.qml | 222 +++++++++++++ .../wearable/qml/Navigation/NavigationMain.qml | 125 ------- .../wearable/qml/Navigation/NavigationPage.qml | 125 +++++++ .../qml/Notifications/NotificationsMain.qml | 175 ---------- .../qml/Notifications/NotificationsPage.qml | 175 ++++++++++ .../wearable/qml/Settings/SettingsMain.qml | 183 ----------- .../wearable/qml/Settings/SettingsPage.qml | 183 +++++++++++ .../wearable/qml/WatchFace/WatchFaceMain.qml | 127 -------- .../wearable/qml/WatchFace/WatchFacePage.qml | 127 ++++++++ .../wearable/qml/Weather/WeatherMain.qml | 359 --------------------- .../wearable/qml/Weather/WeatherPage.qml | 359 +++++++++++++++++++++ examples/quickcontrols2/wearable/wearable.qml | 2 +- examples/quickcontrols2/wearable/wearable.qrc | 16 +- 18 files changed, 1547 insertions(+), 1547 deletions(-) delete mode 100644 examples/quickcontrols2/wearable/qml/Alarms/AlarmsMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/Fitness/FitnessMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/LauncherMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/LauncherPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/Navigation/NavigationMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/Notifications/NotificationsMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/Settings/SettingsMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/WatchFace/WatchFaceMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/WatchFace/WatchFacePage.qml delete mode 100644 examples/quickcontrols2/wearable/qml/Weather/WeatherMain.qml create mode 100644 examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml diff --git a/examples/quickcontrols2/wearable/qml/Alarms/AlarmsMain.qml b/examples/quickcontrols2/wearable/qml/Alarms/AlarmsMain.qml deleted file mode 100644 index bac1ca87..00000000 --- a/examples/quickcontrols2/wearable/qml/Alarms/AlarmsMain.qml +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQC2 -import "../Style" -import "alarms.js" as AlarmData - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: width - - QQC2.SwipeView { - id: svAlarmsContainer - - anchors.fill: parent - anchors.bottomMargin: 50 - - clip: true - currentIndex: 0 - - Item { - id: alarmsPage1 - - Column { - anchors.centerIn: parent - width: parent.width - spacing: 30 - - Row { - anchors.right: parent.right - anchors.rightMargin: 40 - height: 30 - QQC2.Switch { - id: alarmsPage1State - checked: AlarmData.weekdaysAlarmDefaultState() - } - } - - Text { - anchors.horizontalCenter: parent.horizontalCenter - height: 30 - text: AlarmData.weekdaysAlarm() - font.bold: alarmsPage1State.checked - font.pixelSize: alarmsPage1State.checked ? - UIStyle.fontSizeXL : UIStyle.fontSizeL - font.letterSpacing: 4 - color: UIStyle.colorQtGray1 - } - - Text { - anchors.horizontalCenter: parent.horizontalCenter - height: 30 - text: qsTr("Week Days") - font.pixelSize: UIStyle.fontSizeS - font.italic: true - font.bold: true - font.letterSpacing: 1 - color: UIStyle.colorQtGray2 - } - } - } - - Item { - id: alarmsPage2 - - Column { - anchors.centerIn: parent - width: parent.width - spacing: 30 - - Row { - anchors.right: parent.right - anchors.rightMargin: 40 - height: 30 - QQC2.Switch { - id: alarmsPage2State - checked: AlarmData.weekendAlarmDefaultState() - } - } - - Text { - anchors.horizontalCenter: parent.horizontalCenter - height: 30 - text: AlarmData.weekendAlarm() - font.bold: alarmsPage2State.checked - font.pixelSize: alarmsPage2State.checked ? - UIStyle.fontSizeXL : UIStyle.fontSizeL - font.letterSpacing: 4 - color: UIStyle.colorQtGray1 - } - - Text { - anchors.horizontalCenter: parent.horizontalCenter - height: 30 - text: qsTr("Week Ends") - font.pixelSize: UIStyle.fontSizeS - font.italic: true - font.bold: true - font.letterSpacing: 1 - color: UIStyle.colorQtGray2 - } - } - } - } - - QQC2.PageIndicator { - id: pgAlarmsIndicator - - anchors.bottom: svAlarmsContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svAlarmsContainer.count - currentIndex: svAlarmsContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgAlarmsIndicator.currentIndex ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml b/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml new file mode 100644 index 00000000..bac1ca87 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQC2 +import "../Style" +import "alarms.js" as AlarmData + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: width + + QQC2.SwipeView { + id: svAlarmsContainer + + anchors.fill: parent + anchors.bottomMargin: 50 + + clip: true + currentIndex: 0 + + Item { + id: alarmsPage1 + + Column { + anchors.centerIn: parent + width: parent.width + spacing: 30 + + Row { + anchors.right: parent.right + anchors.rightMargin: 40 + height: 30 + QQC2.Switch { + id: alarmsPage1State + checked: AlarmData.weekdaysAlarmDefaultState() + } + } + + Text { + anchors.horizontalCenter: parent.horizontalCenter + height: 30 + text: AlarmData.weekdaysAlarm() + font.bold: alarmsPage1State.checked + font.pixelSize: alarmsPage1State.checked ? + UIStyle.fontSizeXL : UIStyle.fontSizeL + font.letterSpacing: 4 + color: UIStyle.colorQtGray1 + } + + Text { + anchors.horizontalCenter: parent.horizontalCenter + height: 30 + text: qsTr("Week Days") + font.pixelSize: UIStyle.fontSizeS + font.italic: true + font.bold: true + font.letterSpacing: 1 + color: UIStyle.colorQtGray2 + } + } + } + + Item { + id: alarmsPage2 + + Column { + anchors.centerIn: parent + width: parent.width + spacing: 30 + + Row { + anchors.right: parent.right + anchors.rightMargin: 40 + height: 30 + QQC2.Switch { + id: alarmsPage2State + checked: AlarmData.weekendAlarmDefaultState() + } + } + + Text { + anchors.horizontalCenter: parent.horizontalCenter + height: 30 + text: AlarmData.weekendAlarm() + font.bold: alarmsPage2State.checked + font.pixelSize: alarmsPage2State.checked ? + UIStyle.fontSizeXL : UIStyle.fontSizeL + font.letterSpacing: 4 + color: UIStyle.colorQtGray1 + } + + Text { + anchors.horizontalCenter: parent.horizontalCenter + height: 30 + text: qsTr("Week Ends") + font.pixelSize: UIStyle.fontSizeS + font.italic: true + font.bold: true + font.letterSpacing: 1 + color: UIStyle.colorQtGray2 + } + } + } + } + + QQC2.PageIndicator { + id: pgAlarmsIndicator + + anchors.bottom: svAlarmsContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svAlarmsContainer.count + currentIndex: svAlarmsContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgAlarmsIndicator.currentIndex ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/Fitness/FitnessMain.qml b/examples/quickcontrols2/wearable/qml/Fitness/FitnessMain.qml deleted file mode 100644 index 59ac0925..00000000 --- a/examples/quickcontrols2/wearable/qml/Fitness/FitnessMain.qml +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQ2 -import "../Style" -import "fitness.js" as FitnessData - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - QQ2.SwipeView { - id: svFitnessContainer - - anchors.fill: parent - - clip: true - currentIndex: 0 - - Item { - id: fitnessPage1 - - Column { - anchors.centerIn: parent - spacing: 15 - - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Steps: ") + FitnessData.getSteps() - font.italic: true - font.pixelSize: UIStyle.fontSizeM - color: UIStyle.colorQtGray1 - } - Image { - anchors.horizontalCenter: parent.horizontalCenter - height: 64 - width: 64 - source: "../../images/fitness/man-walking.png" - } - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Calories: ") + FitnessData.getCalories() - font.pixelSize: UIStyle.fontSizeS - font.italic: true - color: UIStyle.colorQtGray3 - } - } - } - - Item { - id: fitnessPage2 - - Column { - anchors.centerIn: parent - spacing: 15 - - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Distance: ") - + FitnessData.getDistance() - + qsTr(" miles") - font.italic: true - font.pixelSize: UIStyle.fontSizeM - color: UIStyle.colorQtGray1 - } - Image { - anchors.horizontalCenter: parent.horizontalCenter - height: 64 - width: 64 - source: "../../images/fitness/man-running.png" - } - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("Time: ") - + FitnessData.getTime() - + qsTr(" mins") - font.pixelSize: UIStyle.fontSizeS - font.italic: true - color: UIStyle.colorQtGray3 - } - } - } - } - - QQ2.PageIndicator { - id: pgFitnessIndicator - - anchors.bottom: svFitnessContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svFitnessContainer.count - currentIndex: svFitnessContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgFitnessIndicator.currentIndex ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml b/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml new file mode 100644 index 00000000..59ac0925 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQ2 +import "../Style" +import "fitness.js" as FitnessData + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + QQ2.SwipeView { + id: svFitnessContainer + + anchors.fill: parent + + clip: true + currentIndex: 0 + + Item { + id: fitnessPage1 + + Column { + anchors.centerIn: parent + spacing: 15 + + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Steps: ") + FitnessData.getSteps() + font.italic: true + font.pixelSize: UIStyle.fontSizeM + color: UIStyle.colorQtGray1 + } + Image { + anchors.horizontalCenter: parent.horizontalCenter + height: 64 + width: 64 + source: "../../images/fitness/man-walking.png" + } + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Calories: ") + FitnessData.getCalories() + font.pixelSize: UIStyle.fontSizeS + font.italic: true + color: UIStyle.colorQtGray3 + } + } + } + + Item { + id: fitnessPage2 + + Column { + anchors.centerIn: parent + spacing: 15 + + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Distance: ") + + FitnessData.getDistance() + + qsTr(" miles") + font.italic: true + font.pixelSize: UIStyle.fontSizeM + color: UIStyle.colorQtGray1 + } + Image { + anchors.horizontalCenter: parent.horizontalCenter + height: 64 + width: 64 + source: "../../images/fitness/man-running.png" + } + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Time: ") + + FitnessData.getTime() + + qsTr(" mins") + font.pixelSize: UIStyle.fontSizeS + font.italic: true + color: UIStyle.colorQtGray3 + } + } + } + } + + QQ2.PageIndicator { + id: pgFitnessIndicator + + anchors.bottom: svFitnessContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svFitnessContainer.count + currentIndex: svFitnessContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgFitnessIndicator.currentIndex ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/LauncherMain.qml b/examples/quickcontrols2/wearable/qml/LauncherMain.qml deleted file mode 100644 index f1fd02d1..00000000 --- a/examples/quickcontrols2/wearable/qml/LauncherMain.qml +++ /dev/null @@ -1,222 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import "WatchFace" -import "Fitness" -import "Navigation" -import "Style" - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleDiameter - - ListModel { - id: viewModel - - ListElement { // 0 - title: qsTr("World Clock") - icon: "../images/watchface/watch.png" - page: "WatchFace/WatchFaceMain.qml" - } - ListElement { // 1 - title: qsTr("Navigation") - icon: "../images/navigation/route.png" - page: "Navigation/NavigationMain.qml" - } - ListElement { // 2 - title: qsTr("Weather") - icon: "../images/weather/weather.png" - page: "Weather/WeatherMain.qml" - } - ListElement { // 3 - title: qsTr("Fitness") - icon: "../images/fitness/fitness.png" - page: "Fitness/FitnessMain.qml" - } - ListElement { // 4 - title: qsTr("Notifications") - icon: "../images/notifications/notifications.png" - page: "Notifications/NotificationsMain.qml" - } - ListElement { // 5 - title: qsTr("Alarm") - icon: "../images/alarms/alarms.png" - page: "Alarms/AlarmsMain.qml" - } - ListElement { // 6 - title: qsTr("Settings") - icon: "../images/settings/settings.png" - page: "Settings/SettingsMain.qml" - } - } - - PathView { - id: circularView - property int objSize: 60 - property int cX: parent.width / 2 - property int cY: parent.height / 2 - - currentIndex: 0 - - anchors.fill: parent - model: viewModel - delegate: pathDelegate - snapMode: PathView.SnapToItem - - path: Path { - startX: circularView.cX - startY: circularView.cY - PathAttribute { - name: "itemOpacity" - value: 1.0 - } - PathLine { - x: circularView.width - circularView.objSize - y: circularView.cY - } - PathAttribute { - name: "itemOpacity" - value: 0.7 - } - PathArc { - x: circularView.objSize - y: circularView.cY - radiusX: circularView.cX - circularView.objSize - radiusY: circularView.cY - circularView.objSize - useLargeArc: true - direction: PathArc.Clockwise - } - PathAttribute { - name: "itemOpacity" - value: 0.5 - } - PathArc { - x: circularView.width - circularView.objSize - y: circularView.cY - radiusX: circularView.cX - circularView.objSize - radiusY: circularView.cY - circularView.objSize - useLargeArc: true - direction: PathArc.Clockwise - } - PathAttribute { - name: "itemOpacity" - value: 0.3 - } - } - } - - Component { - id: pathDelegate - - Item { - id: wrapper - - width: childrenRect.width - height: childrenRect.height - - Column { - opacity: wrapper.PathView.itemOpacity - Item { - anchors.horizontalCenter: parent.horizontalCenter - height: wrapper.PathView.view.objSize - width: wrapper.PathView.view.objSize - - Image { - anchors.fill: parent - source: icon - } - Rectangle { - anchors.fill: parent - radius: width / 2 - color: "transparent" - - border.width: 3 - border.color: wrapper.PathView.isCurrentItem ? - "transparent" - : UIStyle.colorQtGray4 - } - } - - Text { - id: appTitle - - opacity: wrapper.PathView.isCurrentItem - && (wrapper.PathView.itemOpacity === 1.0) - - anchors.horizontalCenter: parent.horizontalCenter - font.bold: true - font.pixelSize: UIStyle.fontSizeS - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - text: title - } - } - - MouseArea { - id: pathItemMouseArea - anchors.fill: parent - onClicked: { - if (circularView.currentIndex === index) - loadPage() - else - circularView.currentIndex = index - } - } - function loadPage() { - stackView.push(Qt.resolvedUrl(page)) - } - } - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/LauncherPage.qml b/examples/quickcontrols2/wearable/qml/LauncherPage.qml new file mode 100644 index 00000000..e867d63d --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/LauncherPage.qml @@ -0,0 +1,222 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import "WatchFace" +import "Fitness" +import "Navigation" +import "Style" + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleDiameter + + ListModel { + id: viewModel + + ListElement { // 0 + title: qsTr("World Clock") + icon: "../images/watchface/watch.png" + page: "WatchFace/WatchFacePage.qml" + } + ListElement { // 1 + title: qsTr("Navigation") + icon: "../images/navigation/route.png" + page: "Navigation/NavigationPage.qml" + } + ListElement { // 2 + title: qsTr("Weather") + icon: "../images/weather/weather.png" + page: "Weather/WeatherPage.qml" + } + ListElement { // 3 + title: qsTr("Fitness") + icon: "../images/fitness/fitness.png" + page: "Fitness/FitnessPage.qml" + } + ListElement { // 4 + title: qsTr("Notifications") + icon: "../images/notifications/notifications.png" + page: "Notifications/NotificationsPage.qml" + } + ListElement { // 5 + title: qsTr("Alarm") + icon: "../images/alarms/alarms.png" + page: "Alarms/AlarmsPage.qml" + } + ListElement { // 6 + title: qsTr("Settings") + icon: "../images/settings/settings.png" + page: "Settings/SettingsPage.qml" + } + } + + PathView { + id: circularView + property int objSize: 60 + property int cX: parent.width / 2 + property int cY: parent.height / 2 + + currentIndex: 0 + + anchors.fill: parent + model: viewModel + delegate: pathDelegate + snapMode: PathView.SnapToItem + + path: Path { + startX: circularView.cX + startY: circularView.cY + PathAttribute { + name: "itemOpacity" + value: 1.0 + } + PathLine { + x: circularView.width - circularView.objSize + y: circularView.cY + } + PathAttribute { + name: "itemOpacity" + value: 0.7 + } + PathArc { + x: circularView.objSize + y: circularView.cY + radiusX: circularView.cX - circularView.objSize + radiusY: circularView.cY - circularView.objSize + useLargeArc: true + direction: PathArc.Clockwise + } + PathAttribute { + name: "itemOpacity" + value: 0.5 + } + PathArc { + x: circularView.width - circularView.objSize + y: circularView.cY + radiusX: circularView.cX - circularView.objSize + radiusY: circularView.cY - circularView.objSize + useLargeArc: true + direction: PathArc.Clockwise + } + PathAttribute { + name: "itemOpacity" + value: 0.3 + } + } + } + + Component { + id: pathDelegate + + Item { + id: wrapper + + width: childrenRect.width + height: childrenRect.height + + Column { + opacity: wrapper.PathView.itemOpacity + Item { + anchors.horizontalCenter: parent.horizontalCenter + height: wrapper.PathView.view.objSize + width: wrapper.PathView.view.objSize + + Image { + anchors.fill: parent + source: icon + } + Rectangle { + anchors.fill: parent + radius: width / 2 + color: "transparent" + + border.width: 3 + border.color: wrapper.PathView.isCurrentItem ? + "transparent" + : UIStyle.colorQtGray4 + } + } + + Text { + id: appTitle + + opacity: wrapper.PathView.isCurrentItem + && (wrapper.PathView.itemOpacity === 1.0) + + anchors.horizontalCenter: parent.horizontalCenter + font.bold: true + font.pixelSize: UIStyle.fontSizeS + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + text: title + } + } + + MouseArea { + id: pathItemMouseArea + anchors.fill: parent + onClicked: { + if (circularView.currentIndex === index) + loadPage() + else + circularView.currentIndex = index + } + } + function loadPage() { + stackView.push(Qt.resolvedUrl(page)) + } + } + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/Navigation/NavigationMain.qml b/examples/quickcontrols2/wearable/qml/Navigation/NavigationMain.qml deleted file mode 100644 index c8e81315..00000000 --- a/examples/quickcontrols2/wearable/qml/Navigation/NavigationMain.qml +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import "../Style" -import "navigation.js" as NavigationData - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - Column { - anchors.fill: parent - spacing: 2 - - Rectangle { - id: titleRowCntr - - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - height: 64 - - color: UIStyle.colorQtGray9 - - Row { - spacing: 10 - anchors.centerIn: parent - - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/navigation/route.png" - fillMode: Image.PreserveAspectCrop - } - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Walking") - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 2 - color: UIStyle.colorQtGray2 - } - } - } - - ListModel { - id: routeModel - } - - ListView { - id: routeView - - width: parent.width - height: UIStyle.visibleRectHeight - titleRowCntr.height - property var imageList: ["straight.png", - "leftturn.png", - "rightturn.png", - "uturn.png", - "start.png", - "end.png"] - - clip: true - focus: true - boundsBehavior: Flickable.StopAtBounds - snapMode: ListView.SnapToItem - currentIndex: 0 - model: routeModel - delegate: RouteElement {} - } - } - } - Component.onCompleted: { - NavigationData.requestNavigationRoute(routeModel) - } -} diff --git a/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml new file mode 100644 index 00000000..c8e81315 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import "../Style" +import "navigation.js" as NavigationData + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + Column { + anchors.fill: parent + spacing: 2 + + Rectangle { + id: titleRowCntr + + anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + height: 64 + + color: UIStyle.colorQtGray9 + + Row { + spacing: 10 + anchors.centerIn: parent + + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/navigation/route.png" + fillMode: Image.PreserveAspectCrop + } + Text { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Walking") + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 2 + color: UIStyle.colorQtGray2 + } + } + } + + ListModel { + id: routeModel + } + + ListView { + id: routeView + + width: parent.width + height: UIStyle.visibleRectHeight - titleRowCntr.height + property var imageList: ["straight.png", + "leftturn.png", + "rightturn.png", + "uturn.png", + "start.png", + "end.png"] + + clip: true + focus: true + boundsBehavior: Flickable.StopAtBounds + snapMode: ListView.SnapToItem + currentIndex: 0 + model: routeModel + delegate: RouteElement {} + } + } + } + Component.onCompleted: { + NavigationData.requestNavigationRoute(routeModel) + } +} diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsMain.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsMain.qml deleted file mode 100644 index da829707..00000000 --- a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsMain.qml +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQC2 -import "../Style" -import "notifications.js" as NotificationData - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - QQC2.SwipeView { - id: svNotificationsContainer - - anchors.fill: parent - - clip: true - currentIndex: 0 - - Item { - id: notificationsPage1 - - ListModel { - id: missedCallsList - } - - Row { - anchors.fill: parent - leftPadding: 30 - spacing: 2 - - Image { - id: missedCallIcon - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/notifications/missedcall.png" - } - - ListView { - id: missedCallsView - width: parent.width - missedCallIcon.width - height: parent.height - - clip: true - focus: true - boundsBehavior: Flickable.StopAtBounds - snapMode: ListView.SnapToItem - - model: missedCallsList - - delegate: Item { - height: missedCallsView.height - width: missedCallsView.width - Column { - anchors.fill: parent - spacing: 15 - topPadding: 35 - Image { - anchors.horizontalCenter: - parent.horizontalCenter - height: 64 - width: 64 - source: (gender == "m") ? - "../../images/notifications/avatarm.png" - :"../../images/notifications/avatarf.png" - } - - Text { - anchors.horizontalCenter: - parent.horizontalCenter - text: name - font.bold: true - font.pixelSize: UIStyle.fontSizeS - color: UIStyle.colorQtGray1 - } - Text { - anchors.horizontalCenter: - parent.horizontalCenter - text: date + " " + time - font.pixelSize: UIStyle.fontSizeXS - font.italic: true - color: UIStyle.colorQtGray2 - } - } - } - } - } - } - } - - QQC2.PageIndicator { - id: pgNotificationsIndicator - - anchors.bottom: svNotificationsContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svNotificationsContainer.count - currentIndex: svNotificationsContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgNotificationsIndicator.currentIndex - ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } - - Component.onCompleted: { - NotificationData.populateData(missedCallsList) - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml new file mode 100644 index 00000000..da829707 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml @@ -0,0 +1,175 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQC2 +import "../Style" +import "notifications.js" as NotificationData + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + QQC2.SwipeView { + id: svNotificationsContainer + + anchors.fill: parent + + clip: true + currentIndex: 0 + + Item { + id: notificationsPage1 + + ListModel { + id: missedCallsList + } + + Row { + anchors.fill: parent + leftPadding: 30 + spacing: 2 + + Image { + id: missedCallIcon + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/notifications/missedcall.png" + } + + ListView { + id: missedCallsView + width: parent.width - missedCallIcon.width + height: parent.height + + clip: true + focus: true + boundsBehavior: Flickable.StopAtBounds + snapMode: ListView.SnapToItem + + model: missedCallsList + + delegate: Item { + height: missedCallsView.height + width: missedCallsView.width + Column { + anchors.fill: parent + spacing: 15 + topPadding: 35 + Image { + anchors.horizontalCenter: + parent.horizontalCenter + height: 64 + width: 64 + source: (gender == "m") ? + "../../images/notifications/avatarm.png" + :"../../images/notifications/avatarf.png" + } + + Text { + anchors.horizontalCenter: + parent.horizontalCenter + text: name + font.bold: true + font.pixelSize: UIStyle.fontSizeS + color: UIStyle.colorQtGray1 + } + Text { + anchors.horizontalCenter: + parent.horizontalCenter + text: date + " " + time + font.pixelSize: UIStyle.fontSizeXS + font.italic: true + color: UIStyle.colorQtGray2 + } + } + } + } + } + } + } + + QQC2.PageIndicator { + id: pgNotificationsIndicator + + anchors.bottom: svNotificationsContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svNotificationsContainer.count + currentIndex: svNotificationsContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgNotificationsIndicator.currentIndex + ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } + + Component.onCompleted: { + NotificationData.populateData(missedCallsList) + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/Settings/SettingsMain.qml b/examples/quickcontrols2/wearable/qml/Settings/SettingsMain.qml deleted file mode 100644 index 45a050c9..00000000 --- a/examples/quickcontrols2/wearable/qml/Settings/SettingsMain.qml +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQC2 -import "../Style" - -Item { - Item { - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - SettingsData { - id: settingsData - } - - QQC2.SwipeView { - id: svSettingsContainer - - anchors.fill: parent - - clip: true - currentIndex: 0 - - Item { - id: settingsPage1 - - Column { - anchors.centerIn: parent - spacing: 25 - - Row { - spacing: 50 - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/settings/bluetooth.png" - } - QQC2.Switch { - id: bluetoothSwitch - anchors.verticalCenter: parent.verticalCenter - checked: settingsData.bluetooth.state - } - } - Row { - spacing: 50 - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/settings/wifi.png" - } - QQC2.Switch { - id: wirelessSwitch - anchors.verticalCenter: parent.verticalCenter - checked: settingsData.wireless.state - } - } - } - } - - Item { - id: settingsPage2 - - Column { - anchors.centerIn: parent - spacing: 2 - - Column { - Image { - anchors.horizontalCenter: parent.horizontalCenter - height: 64 - width: 64 - source: "../../images/settings/brightness.png" - } - QQC2.Slider { - id: brightnessSlider - anchors.horizontalCenter: parent.horizontalCenter - value: settingsData.brightness.value - from: settingsData.brightness.min - to: settingsData.brightness.max - stepSize: settingsData.brightness.steps - } - } - Column { - spacing: 2 - Image { - anchors.horizontalCenter: parent.horizontalCenter - height: 64 - width: 64 - source: "../../images/settings/contrast.png" - } - QQC2.Slider { - id: contrastSlider - anchors.horizontalCenter: parent.horizontalCenter - value: settingsData.contrast.value - from: settingsData.contrast.min - to: settingsData.contrast.max - stepSize: settingsData.contrast.steps - } - } - } - } - } - - QQC2.PageIndicator { - id: pgSettingsIndicator - - anchors.bottom: svSettingsContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svSettingsContainer.count - currentIndex: svSettingsContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgSettingsIndicator.currentIndex ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml new file mode 100644 index 00000000..45a050c9 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQC2 +import "../Style" + +Item { + Item { + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + SettingsData { + id: settingsData + } + + QQC2.SwipeView { + id: svSettingsContainer + + anchors.fill: parent + + clip: true + currentIndex: 0 + + Item { + id: settingsPage1 + + Column { + anchors.centerIn: parent + spacing: 25 + + Row { + spacing: 50 + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/settings/bluetooth.png" + } + QQC2.Switch { + id: bluetoothSwitch + anchors.verticalCenter: parent.verticalCenter + checked: settingsData.bluetooth.state + } + } + Row { + spacing: 50 + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/settings/wifi.png" + } + QQC2.Switch { + id: wirelessSwitch + anchors.verticalCenter: parent.verticalCenter + checked: settingsData.wireless.state + } + } + } + } + + Item { + id: settingsPage2 + + Column { + anchors.centerIn: parent + spacing: 2 + + Column { + Image { + anchors.horizontalCenter: parent.horizontalCenter + height: 64 + width: 64 + source: "../../images/settings/brightness.png" + } + QQC2.Slider { + id: brightnessSlider + anchors.horizontalCenter: parent.horizontalCenter + value: settingsData.brightness.value + from: settingsData.brightness.min + to: settingsData.brightness.max + stepSize: settingsData.brightness.steps + } + } + Column { + spacing: 2 + Image { + anchors.horizontalCenter: parent.horizontalCenter + height: 64 + width: 64 + source: "../../images/settings/contrast.png" + } + QQC2.Slider { + id: contrastSlider + anchors.horizontalCenter: parent.horizontalCenter + value: settingsData.contrast.value + from: settingsData.contrast.min + to: settingsData.contrast.max + stepSize: settingsData.contrast.steps + } + } + } + } + } + + QQC2.PageIndicator { + id: pgSettingsIndicator + + anchors.bottom: svSettingsContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svSettingsContainer.count + currentIndex: svSettingsContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgSettingsIndicator.currentIndex ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/WatchFace/WatchFaceMain.qml b/examples/quickcontrols2/wearable/qml/WatchFace/WatchFaceMain.qml deleted file mode 100644 index 33e6dcfb..00000000 --- a/examples/quickcontrols2/wearable/qml/WatchFace/WatchFaceMain.qml +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQC2 -import "../Style" - -Item { - QQC2.SwipeView { - id: svWatchContainer - - anchors.fill: parent - currentIndex: 0 - - ListModel { - id: placesList - ListElement { - cityName: "New York" - timeShift: -4 - } - ListElement { - cityName: "London" - timeShift: 0 - } - ListElement { - cityName: "Oslo" - timeShift: 1 - } - ListElement { - cityName: "Mumbai" - timeShift: 5.5 - } - ListElement { - cityName: "Tokyo" - timeShift: 9 - } - ListElement { - cityName: "Brisbane" - timeShift: 10 - } - ListElement { - cityName: "Los Angeles" - timeShift: -8 - } - } - - Repeater { - model: placesList - delegate: Clock { - } - } - } - - QQC2.PageIndicator { - id: pgWatchIndicator - - anchors.bottom: svWatchContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svWatchContainer.count - currentIndex: svWatchContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgWatchIndicator.currentIndex ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/WatchFace/WatchFacePage.qml b/examples/quickcontrols2/wearable/qml/WatchFace/WatchFacePage.qml new file mode 100644 index 00000000..33e6dcfb --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WatchFace/WatchFacePage.qml @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQC2 +import "../Style" + +Item { + QQC2.SwipeView { + id: svWatchContainer + + anchors.fill: parent + currentIndex: 0 + + ListModel { + id: placesList + ListElement { + cityName: "New York" + timeShift: -4 + } + ListElement { + cityName: "London" + timeShift: 0 + } + ListElement { + cityName: "Oslo" + timeShift: 1 + } + ListElement { + cityName: "Mumbai" + timeShift: 5.5 + } + ListElement { + cityName: "Tokyo" + timeShift: 9 + } + ListElement { + cityName: "Brisbane" + timeShift: 10 + } + ListElement { + cityName: "Los Angeles" + timeShift: -8 + } + } + + Repeater { + model: placesList + delegate: Clock { + } + } + } + + QQC2.PageIndicator { + id: pgWatchIndicator + + anchors.bottom: svWatchContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svWatchContainer.count + currentIndex: svWatchContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgWatchIndicator.currentIndex ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } +} diff --git a/examples/quickcontrols2/wearable/qml/Weather/WeatherMain.qml b/examples/quickcontrols2/wearable/qml/Weather/WeatherMain.qml deleted file mode 100644 index b66a149b..00000000 --- a/examples/quickcontrols2/wearable/qml/Weather/WeatherMain.qml +++ /dev/null @@ -1,359 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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.7 -import QtQuick.Controls 2.0 as QQC2 -import "../Style" -import "weather.js" as WeatherData - -Item { - Item { - id: weatherCntr - anchors.centerIn: parent - - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - QQC2.SwipeView { - id: svWeatherContainer - - anchors.fill: parent - currentIndex: 0 - - Item { - id: weatherPage1 - - Row { - anchors.centerIn: parent - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - padding: 20 - spacing: 2 - - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/temperature.png" - } - - Column { - anchors.verticalCenter: parent.verticalCenter - height: parent.height - topPadding: 20 - spacing: 40 - - Text { - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.temp) ? - qsTr("Avg: ") - + String(wDataCntr.weatherData.main.temp) - + " °F" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - Text { - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.temp_min) ? - qsTr("Min: ") - + String(wDataCntr.weatherData.main.temp_min) - + " °F" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - Text { - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.temp_max) ? - qsTr("Max: ") - + String(wDataCntr.weatherData.main.temp_max) - + " °F " : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - } - } - - Item { - id: weatherPage2 - - Column { - anchors.centerIn: parent - width: UIStyle.visibleRectWidth - height: UIStyle.visibleRectHeight - - Item { - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height / 2 - width: parent.width - - Image { - id: wImg - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/wind.png" - } - - Text { - anchors.left: wImg.right - leftPadding: 20 - anchors.verticalCenter: parent.verticalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.wind - && wDataCntr.weatherData.wind.speed) ? - String(wDataCntr.weatherData.wind.speed) - + " mph" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - Item { - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height / 2 - width: parent.width - - Image { - id: hImg - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/humidity.png" - } - Text { - anchors.left: hImg.right - leftPadding: 20 - anchors.verticalCenter: parent.verticalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.humidity) ? - String(wDataCntr.weatherData.main.humidity) - + " %" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - } - } - - Item { - id: weatherPage3 - - Row { - anchors.centerIn: parent - width: UIStyle.visibleRectWidth - height: UIStyle.visibleRectHeight - spacing: 10 - - Image { - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/pressure.png" - } - - Column { - anchors.verticalCenter: parent.verticalCenter - height: parent.height - topPadding: 25 - spacing: 40 - - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.pressure) ? - String(wDataCntr.weatherData.main.pressure) - + " hPa" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.sea_level) ? - String(wDataCntr.weatherData.main.sea_level) - + " hPa" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - Text { - anchors.horizontalCenter: parent.horizontalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.main - && wDataCntr.weatherData.main.grnd_level) ? - String(wDataCntr.weatherData.main.grnd_level) - + " hPa" : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - } - } - - Item { - id: weatherPage4 - - Column { - anchors.centerIn: parent - width: UIStyle.visibleDiameter - height: UIStyle.visibleRectHeight - - Item { - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height / 2 - width: parent.width - - Image { - anchors.left: parent.left - anchors.leftMargin: 30 - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/sunrise.png" - } - - Text { - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.verticalCenter: parent.verticalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.sys - && wDataCntr.weatherData.sys.sunrise) ? - WeatherData.getTimeHMS(wDataCntr.weatherData.sys.sunrise) - : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - - Item { - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height / 2 - width: parent.width - - Image { - anchors.left: parent.left - anchors.leftMargin: 30 - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "../../images/weather/sunset.png" - } - - Text { - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.verticalCenter: parent.verticalCenter - text: (wDataCntr.weatherData - && wDataCntr.weatherData.sys - && wDataCntr.weatherData.sys.sunset) ? - WeatherData.getTimeHMS(wDataCntr.weatherData.sys.sunset) - : "N/A" - font.pixelSize: UIStyle.fontSizeM - font.letterSpacing: 1 - color: UIStyle.colorQtGray1 - } - } - } - } - } - - QtObject { - id: wDataCntr - property var weatherData - } - - QQC2.PageIndicator { - id: pgWeatherIndicator - - anchors.bottom: svWeatherContainer.bottom - anchors.bottomMargin: 1 - anchors.horizontalCenter: parent.horizontalCenter - - count: svWeatherContainer.count - currentIndex: svWeatherContainer.currentIndex - - delegate: Rectangle { - implicitWidth: 8 - implicitHeight: 8 - - radius: width / 2 - color: UIStyle.colorQtGray3 - - opacity: index === pgWeatherIndicator.currentIndex ? 1.0 : 0.35 - - Behavior on opacity { - OpacityAnimator { - duration: 100 - } - } - } - } - Component.onCompleted: { - WeatherData.requestWeatherData(wDataCntr) - } - } -} diff --git a/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml b/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml new file mode 100644 index 00000000..b66a149b --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml @@ -0,0 +1,359 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $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.7 +import QtQuick.Controls 2.0 as QQC2 +import "../Style" +import "weather.js" as WeatherData + +Item { + Item { + id: weatherCntr + anchors.centerIn: parent + + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + QQC2.SwipeView { + id: svWeatherContainer + + anchors.fill: parent + currentIndex: 0 + + Item { + id: weatherPage1 + + Row { + anchors.centerIn: parent + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + padding: 20 + spacing: 2 + + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/temperature.png" + } + + Column { + anchors.verticalCenter: parent.verticalCenter + height: parent.height + topPadding: 20 + spacing: 40 + + Text { + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.temp) ? + qsTr("Avg: ") + + String(wDataCntr.weatherData.main.temp) + + " °F" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + Text { + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.temp_min) ? + qsTr("Min: ") + + String(wDataCntr.weatherData.main.temp_min) + + " °F" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + Text { + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.temp_max) ? + qsTr("Max: ") + + String(wDataCntr.weatherData.main.temp_max) + + " °F " : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + } + } + + Item { + id: weatherPage2 + + Column { + anchors.centerIn: parent + width: UIStyle.visibleRectWidth + height: UIStyle.visibleRectHeight + + Item { + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height / 2 + width: parent.width + + Image { + id: wImg + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/wind.png" + } + + Text { + anchors.left: wImg.right + leftPadding: 20 + anchors.verticalCenter: parent.verticalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.wind + && wDataCntr.weatherData.wind.speed) ? + String(wDataCntr.weatherData.wind.speed) + + " mph" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + Item { + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height / 2 + width: parent.width + + Image { + id: hImg + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/humidity.png" + } + Text { + anchors.left: hImg.right + leftPadding: 20 + anchors.verticalCenter: parent.verticalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.humidity) ? + String(wDataCntr.weatherData.main.humidity) + + " %" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + } + } + + Item { + id: weatherPage3 + + Row { + anchors.centerIn: parent + width: UIStyle.visibleRectWidth + height: UIStyle.visibleRectHeight + spacing: 10 + + Image { + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/pressure.png" + } + + Column { + anchors.verticalCenter: parent.verticalCenter + height: parent.height + topPadding: 25 + spacing: 40 + + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.pressure) ? + String(wDataCntr.weatherData.main.pressure) + + " hPa" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.sea_level) ? + String(wDataCntr.weatherData.main.sea_level) + + " hPa" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.main + && wDataCntr.weatherData.main.grnd_level) ? + String(wDataCntr.weatherData.main.grnd_level) + + " hPa" : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + } + } + + Item { + id: weatherPage4 + + Column { + anchors.centerIn: parent + width: UIStyle.visibleDiameter + height: UIStyle.visibleRectHeight + + Item { + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height / 2 + width: parent.width + + Image { + anchors.left: parent.left + anchors.leftMargin: 30 + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/sunrise.png" + } + + Text { + anchors.right: parent.right + anchors.rightMargin: 30 + anchors.verticalCenter: parent.verticalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.sys + && wDataCntr.weatherData.sys.sunrise) ? + WeatherData.getTimeHMS(wDataCntr.weatherData.sys.sunrise) + : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + + Item { + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height / 2 + width: parent.width + + Image { + anchors.left: parent.left + anchors.leftMargin: 30 + anchors.verticalCenter: parent.verticalCenter + height: 64 + width: 64 + source: "../../images/weather/sunset.png" + } + + Text { + anchors.right: parent.right + anchors.rightMargin: 30 + anchors.verticalCenter: parent.verticalCenter + text: (wDataCntr.weatherData + && wDataCntr.weatherData.sys + && wDataCntr.weatherData.sys.sunset) ? + WeatherData.getTimeHMS(wDataCntr.weatherData.sys.sunset) + : "N/A" + font.pixelSize: UIStyle.fontSizeM + font.letterSpacing: 1 + color: UIStyle.colorQtGray1 + } + } + } + } + } + + QtObject { + id: wDataCntr + property var weatherData + } + + QQC2.PageIndicator { + id: pgWeatherIndicator + + anchors.bottom: svWeatherContainer.bottom + anchors.bottomMargin: 1 + anchors.horizontalCenter: parent.horizontalCenter + + count: svWeatherContainer.count + currentIndex: svWeatherContainer.currentIndex + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: UIStyle.colorQtGray3 + + opacity: index === pgWeatherIndicator.currentIndex ? 1.0 : 0.35 + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + } + Component.onCompleted: { + WeatherData.requestWeatherData(wDataCntr) + } + } +} diff --git a/examples/quickcontrols2/wearable/wearable.qml b/examples/quickcontrols2/wearable/wearable.qml index 15c75494..2603392c 100644 --- a/examples/quickcontrols2/wearable/wearable.qml +++ b/examples/quickcontrols2/wearable/wearable.qml @@ -93,6 +93,6 @@ QQC2.ApplicationWindow { focus: true anchors.fill: parent - initialItem: LauncherMain { } + initialItem: LauncherPage { } } } diff --git a/examples/quickcontrols2/wearable/wearable.qrc b/examples/quickcontrols2/wearable/wearable.qrc index f89f2494..a1099673 100644 --- a/examples/quickcontrols2/wearable/wearable.qrc +++ b/examples/quickcontrols2/wearable/wearable.qrc @@ -2,28 +2,28 @@ wearable.qml qml/Alarms/alarms.js - qml/Alarms/AlarmsMain.qml + qml/Alarms/AlarmsPage.qml qml/Fitness/fitness.js - qml/Fitness/FitnessMain.qml - qml/LauncherMain.qml + qml/Fitness/FitnessPage.qml + qml/LauncherPage.qml qml/NaviButton.qml qml/Navigation/navigation.js - qml/Navigation/NavigationMain.qml + qml/Navigation/NavigationPage.qml qml/Navigation/RouteElement.qml qml/Navigation/walk_route.json qml/Notifications/notifications.js - qml/Notifications/NotificationsMain.qml + qml/Notifications/NotificationsPage.qml qml/Settings/SettingsData.qml - qml/Settings/SettingsMain.qml + qml/Settings/SettingsPage.qml qml/Style/qmldir qml/Style/UIStyle.qml qml/Style/Slider.qml qml/Style/Switch.qml qml/WatchFace/Clock.qml - qml/WatchFace/WatchFaceMain.qml + qml/WatchFace/WatchFacePage.qml qml/Weather/weather.js qml/Weather/weather.json - qml/Weather/WeatherMain.qml + qml/Weather/WeatherPage.qml images/alarms/alarms.png images/background/HomeBackground.png images/back.png -- cgit v1.2.3