aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/wearable/images/background-dark.pngbin0 -> 44625 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/background-light.png (renamed from examples/quickcontrols2/wearable/images/background.png)bin400411 -> 400411 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml10
-rw-r--r--examples/quickcontrols2/wearable/qml/DemoMode.qml258
-rw-r--r--examples/quickcontrols2/wearable/qml/DemoModeIndicator.qml94
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml20
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark.pngbin0 -> 1693 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark@2x.pngbin0 -> 2694 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light.png (renamed from examples/quickcontrols2/wearable/qml/Fitness/images/man-running.png)bin16047 -> 16047 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png)bin2795 -> 2795 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark.pngbin0 -> 1631 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark@2x.pngbin0 -> 2483 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light.png (renamed from examples/quickcontrols2/wearable/qml/Fitness/images/man-walking.png)bin16062 -> 16062 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png)bin2668 -> 2668 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/LauncherPage.qml8
-rw-r--r--examples/quickcontrols2/wearable/qml/NaviButton.qml4
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml22
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/RouteElement.qml10
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark.pngbin0 -> 1940 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark@2x.pngbin0 -> 1583 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/leftturn.png)bin16111 -> 16111 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png)bin2148 -> 2148 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark.pngbin0 -> 704 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark@2x.pngbin0 -> 1068 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/navigation.png)bin581 -> 581 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png)bin1063 -> 1063 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark.pngbin0 -> 1947 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark@2x.pngbin0 -> 1532 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/rightturn.png)bin16077 -> 16077 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png)bin1613 -> 1613 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark.pngbin0 -> 1330 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark@2x.pngbin0 -> 911 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/straight-light.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/straight.png)bin15727 -> 15727 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/straight-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png)bin790 -> 790 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml12
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark.pngbin0 -> 2130 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark@2x.pngbin0 -> 1928 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/avatarf.png)bin16396 -> 16396 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png)bin2183 -> 2183 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark.pngbin0 -> 1909 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark@2x.pngbin0 -> 1739 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/avatarm.png)bin16198 -> 16198 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png)bin2011 -> 2011 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark.pngbin0 -> 2273 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark@2x.pngbin0 -> 1727 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/missedcall.png)bin2833 -> 2833 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png)bin2685 -> 2685 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml67
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.pngbin0 -> 1033 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.pngbin0 -> 3001 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/bluetooth.png)bin2770 -> 2770 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png)bin4123 -> 4123 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.pngbin0 -> 1522 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.pngbin0 -> 1443 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/brightness.png)bin2692 -> 2692 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png)bin2320 -> 2320 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/contrast.pngbin2347 -> 0 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.pngbin1930 -> 0 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.pngbin0 -> 1053 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark@2x.pngbin0 -> 1418 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.pngbin0 -> 1057 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.pngbin0 -> 1737 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.pngbin0 -> 825 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white@2x.pngbin0 -> 1318 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/demo-mode.svg93
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/theme-dark.pngbin0 -> 1433 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.pngbin0 -> 2431 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/theme-light.pngbin0 -> 1628 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.pngbin0 -> 3340 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/theme.svg84
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark.pngbin0 -> 1749 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.pngbin0 -> 1388 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/wifi.png)bin16308 -> 16308 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png)bin2151 -> 2151 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Style/PageIndicator.qml6
-rw-r--r--examples/quickcontrols2/wearable/qml/Style/Slider.qml8
-rw-r--r--examples/quickcontrols2/wearable/qml/Style/Switch.qml10
-rw-r--r--examples/quickcontrols2/wearable/qml/Style/UIStyle.qml25
-rw-r--r--examples/quickcontrols2/wearable/qml/SwipeViewPage.qml4
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml36
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark.pngbin0 -> 1907 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark@2x.pngbin0 -> 1749 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/humidity-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/humidity.png)bin16450 -> 16450 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/humidity-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png)bin3076 -> 3076 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark.pngbin0 -> 1735 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark@2x.pngbin0 -> 1938 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/pressure-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/pressure.png)bin16902 -> 16902 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/pressure-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png)bin3256 -> 3256 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark.pngbin0 -> 2036 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark@2x.pngbin0 -> 1575 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/sunrise.png)bin16534 -> 16534 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png)bin2427 -> 2427 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark.pngbin0 -> 2055 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark@2x.pngbin0 -> 1603 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunset-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/sunset.png)bin16586 -> 16586 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunset-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png)bin2489 -> 2489 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark.pngbin0 -> 1471 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark@2x.pngbin0 -> 1255 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/temperature-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/temperature.png)bin2004 -> 2004 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/temperature-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png)bin1977 -> 1977 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/wind-dark.pngbin0 -> 1993 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/wind-dark@2x.pngbin0 -> 1464 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/wind-light.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/wind.png)bin16440 -> 16440 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/wind-light@2x.png (renamed from examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png)bin2309 -> 2309 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/Clock.qml6
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/WorldClockPage.qml4
-rw-r--r--examples/quickcontrols2/wearable/wearable.cpp3
-rw-r--r--examples/quickcontrols2/wearable/wearable.qml52
-rw-r--r--examples/quickcontrols2/wearable/wearable.qrc125
109 files changed, 815 insertions, 146 deletions
diff --git a/examples/quickcontrols2/wearable/images/background-dark.png b/examples/quickcontrols2/wearable/images/background-dark.png
new file mode 100644
index 00000000..e8eb169d
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/background-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/background.png b/examples/quickcontrols2/wearable/images/background-light.png
index 1c6920e6..1c6920e6 100644
--- a/examples/quickcontrols2/wearable/images/background.png
+++ b/examples/quickcontrols2/wearable/images/background-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml b/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml
index 82a7716f..99343d24 100644
--- a/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Alarms/AlarmsPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import ".."
import "../Style"
@@ -66,6 +66,8 @@ Item {
}
SwipeViewPage {
+ property alias stateSwitch: stateSwitch
+
Column {
spacing: 30
anchors.centerIn: parent
@@ -84,7 +86,7 @@ Item {
font.bold: stateSwitch.checked
font.pixelSize: stateSwitch.checked ? UIStyle.fontSizeXL : UIStyle.fontSizeL
font.letterSpacing: 4
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -95,7 +97,7 @@ Item {
font.italic: true
font.bold: true
font.letterSpacing: 1
- color: UIStyle.colorQtGray2
+ color: UIStyle.themeColorQtGray2
}
}
}
diff --git a/examples/quickcontrols2/wearable/qml/DemoMode.qml b/examples/quickcontrols2/wearable/qml/DemoMode.qml
new file mode 100644
index 00000000..c67a56e6
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/DemoMode.qml
@@ -0,0 +1,258 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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.10
+import QtQuick.Controls 2.3
+
+import "Style"
+
+Item {
+ property StackView stackView
+
+ SequentialAnimation {
+ id: demoModeAnimation
+ running: settings.demoMode
+
+ // Set brightness back to normal.
+ ScriptAction { script: settings.brightness = 0 }
+
+ // Go back to the launcher page.
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the world clock page.
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("WorldClock/WorldClockPage.qml")) }
+ PauseAnimation { duration: 2000 }
+
+ // Swipe across a few times.
+ SequentialAnimation {
+ loops: 6
+
+ ScriptAction { script: stackView.currentItem.children[0].incrementCurrentIndex() }
+ PauseAnimation { duration: 2500 }
+ }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the navigation page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Navigation/NavigationPage.qml")) }
+ PauseAnimation { duration: 2000 }
+
+ // Flick down a few times.
+ SequentialAnimation {
+ loops: 6
+
+ ScriptAction { script: stackView.currentItem.routeListView.incrementCurrentIndex() }
+ PauseAnimation { duration: 2000 }
+ }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the weather page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Weather/WeatherPage.qml")) }
+ PauseAnimation { duration: 2000 }
+
+ // Swipe across a few times.
+ SequentialAnimation {
+ loops: 4
+
+ ScriptAction { script: stackView.currentItem.children[0].incrementCurrentIndex() }
+ PauseAnimation { duration: 2000 }
+ }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the fitness page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Fitness/FitnessPage.qml")) }
+ PauseAnimation { duration: 2000 }
+
+ // Swipe across a few times.
+ SequentialAnimation {
+ loops: 2
+
+ ScriptAction { script: stackView.currentItem.children[0].incrementCurrentIndex() }
+ PauseAnimation { duration: 2000 }
+ }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the notifications page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Notifications/NotificationsPage.qml")) }
+
+ // Flick down a few times.
+ SequentialAnimation {
+ loops: 3
+
+ PauseAnimation { duration: 2000 }
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the alarms page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Alarms/AlarmsPage.qml")) }
+ PauseAnimation { duration: 2000 }
+
+ // Toggle the switch.
+ ScriptAction { script: stackView.currentItem.children[0].currentItem.stateSwitch.toggle() }
+ PauseAnimation { duration: 2000 }
+
+ // Go to the next alarm.
+ ScriptAction { script: stackView.currentItem.children[0].incrementCurrentIndex() }
+ PauseAnimation { duration: 2000 }
+
+ // Toggle the switch there too.
+ ScriptAction { script: stackView.currentItem.children[0].currentItem.stateSwitch.toggle() }
+ PauseAnimation { duration: 2000 }
+
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ PauseAnimation { duration: 2000 }
+
+ // Open the settings page.
+ ScriptAction { script: stackView.currentItem.incrementCurrentIndex() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.launched(Qt.resolvedUrl("Settings/SettingsPage.qml")) }
+ PauseAnimation { duration: 3000 }
+
+ // Toggle the switches.
+ ScriptAction { script: stackView.currentItem.children[0].currentItem.bluetoothSwitch.toggle() }
+ PauseAnimation { duration: 1000 }
+ ScriptAction { script: stackView.currentItem.children[0].currentItem.wirelessSwitch.toggle() }
+ PauseAnimation { duration: 3000 }
+
+ // Go to the next page.
+ ScriptAction { script: stackView.currentItem.children[0].incrementCurrentIndex() }
+
+ // Play with the brightness slider.
+ // First, set it to full brightness so we start in the correct state.
+ ScriptAction {
+ script: {
+ var brightnessSlider = stackView.currentItem.children[0].currentItem.brightnessSlider
+ brightnessSlider.value = 0
+ // increase()/decrease() are not a result of user interaction and
+ // hence moved() will not be emitted, so we do it ourselves.
+ brightnessSlider.moved()
+ }
+ }
+
+ // Decrease the brightness.
+ SequentialAnimation {
+ loops: 3
+
+ PauseAnimation { duration: 1000 }
+ ScriptAction {
+ script: {
+ var brightnessSlider = stackView.currentItem.children[0].currentItem.brightnessSlider
+ brightnessSlider.decrease()
+ brightnessSlider.moved()
+ }
+ }
+ }
+
+ // Increase the brightness back to full.
+ PauseAnimation { duration: 3000 }
+ SequentialAnimation {
+ loops: 3
+
+ PauseAnimation { duration: 1000 }
+ ScriptAction {
+ script: {
+ var brightnessSlider = stackView.currentItem.children[0].currentItem.brightnessSlider
+ brightnessSlider.increase()
+ brightnessSlider.moved()
+ }
+ }
+ }
+
+ // Toggle the dark theme switch.
+ PauseAnimation { duration: 2000 }
+ ScriptAction {
+ script: {
+ var darkThemeSwitch = stackView.currentItem.children[0].currentItem.darkThemeSwitch
+ darkThemeSwitch.toggle()
+ // As above, only proper user interaction results in toggled() being emitted,
+ // so we do it ourselves.
+ darkThemeSwitch.toggled()
+ }
+ }
+ PauseAnimation { duration: 4000 }
+
+ // Go back to the launcher page.
+ ScriptAction { script: stackView.pop(null) }
+ }
+}
diff --git a/examples/quickcontrols2/wearable/qml/DemoModeIndicator.qml b/examples/quickcontrols2/wearable/qml/DemoModeIndicator.qml
new file mode 100644
index 00000000..66ced325
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/DemoModeIndicator.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 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.10
+import QtQuick.Controls 2.3 as QQC2
+import "Style"
+
+Item {
+ id: root
+ width: row.implicitWidth + margins * 2
+
+ readonly property int topMargin: 24
+ readonly property int margins: 12
+
+ Behavior on y {
+ NumberAnimation {}
+ }
+
+ Rectangle {
+ id: demoModeIndicatorBg
+ anchors.fill: parent
+ anchors.topMargin: -topMargin
+ radius: 20
+ color: UIStyle.colorRed
+ }
+
+ Row {
+ id: row
+ spacing: 8
+ anchors.fill: parent
+ anchors.leftMargin: margins
+ anchors.rightMargin: margins
+
+ Image {
+ source: "Settings/images/demo-mode-white.png"
+ width: height
+ height: instructionLabel.height * 2
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ QQC2.Label {
+ id: instructionLabel
+ text: "Tap screen to use"
+ color: UIStyle.colorQtGray10
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+}
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml b/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml
index a9a1cb98..1f018e2e 100644
--- a/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Fitness/FitnessPage.qml
@@ -48,14 +48,14 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQ2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import ".."
import "../Style"
import "fitness.js" as FitnessData
Item {
- QQ2.SwipeView {
+ QQC2.SwipeView {
id: svFitnessContainer
anchors.fill: parent
@@ -72,18 +72,18 @@ Item {
text: qsTr("Steps: ") + FitnessData.getSteps()
font.italic: true
font.pixelSize: UIStyle.fontSizeM
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
- source: "images/man-walking.png"
+ source: UIStyle.themeImagePath("images/man-walking")
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Calories: ") + FitnessData.getCalories()
font.pixelSize: UIStyle.fontSizeS
font.italic: true
- color: UIStyle.colorQtGray3
+ color: UIStyle.themeColorQtGray3
}
}
}
@@ -102,11 +102,11 @@ Item {
+ qsTr(" miles")
font.italic: true
font.pixelSize: UIStyle.fontSizeM
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
- source: "images/man-running.png"
+ source: UIStyle.themeImagePath("images/man-running")
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
@@ -115,13 +115,13 @@ Item {
+ qsTr(" mins")
font.pixelSize: UIStyle.fontSizeS
font.italic: true
- color: UIStyle.colorQtGray3
+ color: UIStyle.themeColorQtGray3
}
}
}
}
- QQ2.PageIndicator {
+ QQC2.PageIndicator {
count: svFitnessContainer.count
currentIndex: svFitnessContainer.currentIndex
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark.png
new file mode 100644
index 00000000..709c4b0f
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark@2x.png
new file mode 100644
index 00000000..1497ba4a
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light.png
index 5efab6e2..5efab6e2 100644
--- a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running.png
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light@2x.png
index 2073d97f..2073d97f 100644
--- a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark.png
new file mode 100644
index 00000000..6de13144
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark@2x.png
new file mode 100644
index 00000000..e094e071
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light.png
index 01add534..01add534 100644
--- a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking.png
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light@2x.png
index 037a8f03..037a8f03 100644
--- a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/LauncherPage.qml b/examples/quickcontrols2/wearable/qml/LauncherPage.qml
index 9d6d9ae9..53c9e5a4 100644
--- a/examples/quickcontrols2/wearable/qml/LauncherPage.qml
+++ b/examples/quickcontrols2/wearable/qml/LauncherPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.1 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import "Style"
PathView {
@@ -118,7 +118,7 @@ PathView {
background: Rectangle {
radius: width / 2
border.width: 3
- border.color: parent.PathView.isCurrentItem ? UIStyle.colorQtPrimGreen : UIStyle.colorQtGray4
+ border.color: parent.PathView.isCurrentItem ? UIStyle.colorQtPrimGreen : UIStyle.themeColorQtGray4
}
onClicked: {
@@ -184,6 +184,6 @@ PathView {
font.bold: true
font.pixelSize: circularView.itemSize / 3
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
diff --git a/examples/quickcontrols2/wearable/qml/NaviButton.qml b/examples/quickcontrols2/wearable/qml/NaviButton.qml
index 7a8f7c14..5058bd62 100644
--- a/examples/quickcontrols2/wearable/qml/NaviButton.qml
+++ b/examples/quickcontrols2/wearable/qml/NaviButton.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import "Style"
QQC2.AbstractButton {
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml
index 185f7986..8ab82bac 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Navigation/NavigationPage.qml
@@ -48,11 +48,13 @@
**
****************************************************************************/
-import QtQuick 2.7
+import QtQuick 2.10
import "../Style"
import "navigation.js" as NavigationData
Item {
+ property alias routeListView: routeView
+
Column {
anchors.fill: parent
anchors.margins: 2
@@ -63,7 +65,7 @@ Item {
width: parent.width
height: titleRow.height
- color: UIStyle.colorQtGray9
+ color: UIStyle.themeColorQtGray9
Row {
id: titleRow
@@ -72,7 +74,7 @@ Item {
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/navigation.png"
+ source: UIStyle.themeImagePath("images/navigation")
fillMode: Image.PreserveAspectCrop
}
Text {
@@ -80,7 +82,7 @@ Item {
text: qsTr("Walking")
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 2
- color: UIStyle.colorQtGray2
+ color: UIStyle.themeColorQtGray2
}
}
}
@@ -94,12 +96,12 @@ Item {
width: parent.width
height: parent.height - titleRow.height - parent.spacing
- property var imageList: ["straight.png",
- "leftturn.png",
- "rightturn.png",
- "uturn.png",
- "start.png",
- "end.png"]
+ property var imageList: [UIStyle.themeImagePath("images/straight"),
+ UIStyle.themeImagePath("images/leftturn"),
+ UIStyle.themeImagePath("images/rightturn"),
+ "images/uturn.png",
+ "images/start.png",
+ "images/end.png"]
clip: true
focus: true
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/RouteElement.qml b/examples/quickcontrols2/wearable/qml/Navigation/RouteElement.qml
index 79928012..937b84a8 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/RouteElement.qml
+++ b/examples/quickcontrols2/wearable/qml/Navigation/RouteElement.qml
@@ -48,11 +48,11 @@
**
****************************************************************************/
-import QtQuick 2.7
+import QtQuick 2.10
import "../Style"
Rectangle {
- color: UIStyle.colorQtGray8
+ color: UIStyle.themeColorQtGray8
Row {
spacing: 5
@@ -62,7 +62,7 @@ Rectangle {
Image {
id: img
anchors.verticalCenter: parent.verticalCenter
- source: "images/" + navImage
+ source: navImage
fillMode: Image.PreserveAspectFit
}
@@ -78,7 +78,7 @@ Rectangle {
font.pixelSize: UIStyle.fontSizeS
verticalAlignment: Text.AlignVCenter
padding: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -88,7 +88,7 @@ Rectangle {
font.pixelSize: UIStyle.fontSizeXS
verticalAlignment: Text.AlignVCenter
padding: 1
- color: UIStyle.colorQtGray2
+ color: UIStyle.themeColorQtGray2
}
}
}
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark.png
new file mode 100644
index 00000000..b318b954
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark@2x.png
new file mode 100644
index 00000000..ec782ebd
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light.png
index 3c416304..3c416304 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light@2x.png
index 39e9be84..39e9be84 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark.png
new file mode 100644
index 00000000..7dce6aa5
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark@2x.png
new file mode 100644
index 00000000..5061e52b
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light.png
index 9b8cb8e6..9b8cb8e6 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light@2x.png
index 8d133abc..8d133abc 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark.png
new file mode 100644
index 00000000..634ab593
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark@2x.png
new file mode 100644
index 00000000..9a388440
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light.png
index a29ec694..a29ec694 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light@2x.png
index 258c4144..258c4144 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark.png
new file mode 100644
index 00000000..014ed7c8
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark@2x.png
new file mode 100644
index 00000000..be51d2ac
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-light.png
index e3c5bb5c..e3c5bb5c 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/straight.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-light@2x.png
index ef71ab1b..ef71ab1b 100644
--- a/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
index d5bec2f8..eeddf6dc 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import "../Style"
import "notifications.js" as NotificationData
@@ -70,7 +70,7 @@ ListView {
width: parent.width / 2
anchors.right: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
- source: "images/missedcall.png"
+ source: UIStyle.themeImagePath("images/missedcall")
fillMode: Image.Pad
}
@@ -85,7 +85,7 @@ ListView {
Image {
anchors.horizontalCenter: parent.horizontalCenter
- source: qsTr("images/avatar%1.png").arg(model.gender)
+ source: qsTr("images/avatar%1-%2.png").arg(model.gender).arg(UIStyle.darkTheme ? "dark" : "light")
}
Text {
@@ -93,7 +93,7 @@ ListView {
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true
font.pixelSize: UIStyle.fontSizeS
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -101,7 +101,7 @@ ListView {
text: date + " " + time
font.pixelSize: UIStyle.fontSizeXS
font.italic: true
- color: UIStyle.colorQtGray2
+ color: UIStyle.themeColorQtGray2
}
}
}
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark.png
new file mode 100644
index 00000000..2a553aed
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark@2x.png
new file mode 100644
index 00000000..a91031f3
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light.png
index c88edc60..c88edc60 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light@2x.png
index 2c916b2c..2c916b2c 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark.png
new file mode 100644
index 00000000..5810312c
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark@2x.png
new file mode 100644
index 00000000..64ddd8ea
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light.png
index f7abb4c9..f7abb4c9 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light@2x.png
index d30eb2d2..d30eb2d2 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark.png
new file mode 100644
index 00000000..4080e3e4
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark@2x.png
new file mode 100644
index 00000000..6002e456
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light.png
index d05f17b3..d05f17b3 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light@2x.png
index d28e62c5..d28e62c5 100644
--- a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml
index 3ed59eb8..bb347e7d 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml
@@ -48,22 +48,13 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
-import Qt.labs.settings 1.0
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import ".."
import "../Style"
Item {
- Settings {
- id: settings
- property alias wireless: wirelessSwitch.checked
- property alias bluetooth: bluetoothSwitch.checked
- property alias contrast: contrastSlider.value
- property alias brightness: brightnessSlider.value
- }
-
QQC2.SwipeView {
id: svSettingsContainer
@@ -72,6 +63,9 @@ Item {
SwipeViewPage {
id: settingsPage1
+ property alias bluetoothSwitch: bluetoothSwitch
+ property alias wirelessSwitch: wirelessSwitch
+
Column {
anchors.centerIn: parent
spacing: 25
@@ -80,24 +74,26 @@ Item {
spacing: 50
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/bluetooth.png"
+ source: UIStyle.themeImagePath("images/bluetooth")
}
QQC2.Switch {
id: bluetoothSwitch
anchors.verticalCenter: parent.verticalCenter
checked: settings.bluetooth
+ onToggled: settings.bluetooth = checked
}
}
Row {
spacing: 50
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/wifi.png"
+ source: UIStyle.themeImagePath("images/wifi")
}
QQC2.Switch {
id: wirelessSwitch
anchors.verticalCenter: parent.verticalCenter
checked: settings.wireless
+ onToggled: settings.wireless = checked
}
}
}
@@ -106,6 +102,9 @@ Item {
SwipeViewPage {
id: settingsPage2
+ property alias brightnessSlider: brightnessSlider
+ property alias darkThemeSwitch: darkThemeSwitch
+
Column {
anchors.centerIn: parent
spacing: 2
@@ -113,7 +112,7 @@ Item {
Column {
Image {
anchors.horizontalCenter: parent.horizontalCenter
- source: "images/brightness.png"
+ source: UIStyle.themeImagePath("images/brightness")
}
QQC2.Slider {
id: brightnessSlider
@@ -122,21 +121,45 @@ Item {
to: 5
stepSize: 1
value: settings.brightness
+ onMoved: settings.brightness = value
}
}
Column {
- spacing: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+
Image {
anchors.horizontalCenter: parent.horizontalCenter
- source: "images/contrast.png"
+ source: UIStyle.themeImagePath("images/theme")
}
- QQC2.Slider {
- id: contrastSlider
+ QQC2.Switch {
+ id: darkThemeSwitch
anchors.horizontalCenter: parent.horizontalCenter
- from: 0
- to: 10
- stepSize: 1
- value: settings.contrast
+ checked: settings.darkTheme
+ onToggled: settings.darkTheme = checked
+ }
+ }
+ }
+ }
+
+ SwipeViewPage {
+ id: settingsPage3
+
+ Column {
+ anchors.centerIn: parent
+
+ Column {
+ anchors.horizontalCenter: parent.horizontalCenter
+ spacing: 6
+
+ Image {
+ anchors.horizontalCenter: parent.horizontalCenter
+ source: UIStyle.themeImagePath("images/demo-mode")
+ }
+ QQC2.Switch {
+ id: demoModeSwitch
+ anchors.horizontalCenter: parent.horizontalCenter
+ checked: settings.demoMode
+ onToggled: settings.demoMode = checked
}
}
}
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png
new file mode 100644
index 00000000..32040b18
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png
new file mode 100644
index 00000000..d29c6d3a
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png
index 2b2d0e7e..2b2d0e7e 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png
index 276d7337..276d7337 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png
new file mode 100644
index 00000000..1904a6a4
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png
new file mode 100644
index 00000000..7cd287e9
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png
index 846a896c..846a896c 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/brightness.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png
index 94753ea6..94753ea6 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/contrast.png b/examples/quickcontrols2/wearable/qml/Settings/images/contrast.png
deleted file mode 100644
index eb528eb8..00000000
--- a/examples/quickcontrols2/wearable/qml/Settings/images/contrast.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png
deleted file mode 100644
index 92e112f9..00000000
--- a/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png
new file mode 100644
index 00000000..571a4645
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark@2x.png
new file mode 100644
index 00000000..a8203b35
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png
new file mode 100644
index 00000000..0f8fcc75
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.png
new file mode 100644
index 00000000..57282a5a
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png
new file mode 100644
index 00000000..1f967488
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white@2x.png
new file mode 100644
index 00000000..fd0611e6
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode.svg b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode.svg
new file mode 100644
index 00000000..ad1ce448
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode.svg
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64"
+ height="64"
+ viewBox="0 0 16.933333 16.933333"
+ version="1.1"
+ id="svg8"
+ inkscape:version="0.92.3 (d244b95, 2018-08-02)"
+ sodipodi:docname="demo-mode.svg"
+ inkscape:export-filename="/home/mitch/dev/qt5.12/qtquickcontrols2/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.png"
+ inkscape:export-xdpi="192"
+ inkscape:export-ydpi="192">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.839192"
+ inkscape:cx="26.498574"
+ inkscape:cy="25.685519"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ fit-margin-top="1"
+ fit-margin-left="1"
+ fit-margin-right="1"
+ fit-margin-bottom="1"
+ inkscape:window-width="3706"
+ inkscape:window-height="2031"
+ inkscape:window-x="134"
+ inkscape:window-y="55"
+ inkscape:window-maximized="1"
+ inkscape:snap-global="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3713"
+ originx="-0.0070880335"
+ originy="-280.58354" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata5">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-0.00708803,0.51688025)">
+ <path
+ style="fill:#141f3a;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 1.6489221,4.3034973 h 0.7205171 v 7.0102767 c 0.01422,0.27678 0.1921164,0.348966 0.392741,0.392741 H 14.169383 c 0.276028,-0.04241 0.382882,-0.208883 0.423747,-0.423747 V 4.3094031 h 0.692464 v 7.0279949 c -0.111554,0.831949 -0.589986,1.000696 -1.104399,1.104399 H 9.3324693 l 2.2589977,2.258998 c -0.0189,0.375139 -0.204956,0.516261 -0.501999,0.502 L 8.8304698,12.943797 v 1.972563 c -0.051861,0.342631 -0.6681357,0.36382 -0.7323291,0 V 12.949702 L 5.8391425,15.208701 C 5.5142667,15.206145 5.3522558,15.056484 5.3725781,14.742136 L 7.7172116,12.397503 H 2.7415096 C 2.1429244,12.357576 1.6879444,12.049089 1.6444927,11.300486 Z"
+ id="path826"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccccccccc" />
+ <rect
+ style="fill:#141f3a;fill-opacity:1;stroke:none;stroke-width:0.2619375;stroke-miterlimit:4;stroke-dasharray:0.523875, 0.2619375;stroke-dashoffset:0"
+ id="rect828"
+ width="16.044523"
+ height="1.9126476"
+ x="0.441401"
+ y="2.0340116"
+ rx="1.0583333"
+ ry="1.0583333" />
+ <path
+ style="fill:#141f3a;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 7.8323763,1.681278 V 1.1615701 c 0.1987987,-0.67546179 1.0821701,-0.66495897 1.2992931,0 V 1.681278 Z"
+ id="path830"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+</svg>
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark.png
new file mode 100644
index 00000000..346ffec3
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png
new file mode 100644
index 00000000..4207d739
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png
new file mode 100644
index 00000000..2f02744c
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png
new file mode 100644
index 00000000..07c4b774
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme.svg b/examples/quickcontrols2/wearable/qml/Settings/images/theme.svg
new file mode 100644
index 00000000..bf3f1e57
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme.svg
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64"
+ height="64"
+ viewBox="0 0 16.933333 16.933333"
+ version="1.1"
+ id="svg8"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="theme.svg"
+ inkscape:export-filename="C:\dev\qt5.11\qtquickcontrols2\examples\quickcontrols2\wearable\qml\Settings\images\theme@2x.png"
+ inkscape:export-xdpi="192"
+ inkscape:export-ydpi="192">
+ <defs
+ id="defs2" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="7.9195959"
+ inkscape:cx="-11.371874"
+ inkscape:cy="28.405259"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ fit-margin-top="1"
+ fit-margin-left="1"
+ fit-margin-right="1"
+ fit-margin-bottom="1"
+ inkscape:window-width="3840"
+ inkscape:window-height="2066"
+ inkscape:window-x="-11"
+ inkscape:window-y="-11"
+ inkscape:window-maximized="1"
+ inkscape:snap-global="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3713"
+ originx="-0.0070880335"
+ originy="-280.58354" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata5">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-0.00708803,0.51688025)">
+ <path
+ style="fill:#141f3a;fill-opacity:1;stroke:none;stroke-width:0.25668776px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 2.7296861,14.56437 H 12.831038 C 13.464556,14.411157 15.01089,14.101758 15.231756,11.825604 15.232242,10.48538 13.96701,8.4813248 11.69084,9.0467292 10.687852,7.3630573 9.1232541,7.2558172 8.2817051,7.654427 6.9050791,4.9744381 2.9222535,5.8560797 2.9703307,8.9435956 1.7108806,9.1004362 0.37826375,9.7182846 0.27167137,11.745388 0.31660717,13.546059 1.5831259,14.350467 2.7296861,14.56437 Z"
+ id="path4535"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ style="fill:#141f3a;fill-opacity:1;stroke:none;stroke-width:0.25668776px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 11.392726,0.92763044 C 8.8246143,2.2754379 7.9809615,4.3443829 8.9780532,7.1830936 10.167295,7.1426991 11.108291,7.6664967 11.822182,8.7064442 12.799984,8.6194307 13.765772,8.6795708 14.658208,9.6382815 15.605885,9.3257847 16.200803,8.852941 16.675838,8.325607 13.735088,9.4033595 8.6151974,5.957728 11.392726,0.92763044 Z"
+ id="path4537"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccc" />
+ </g>
+</svg>
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark.png
new file mode 100644
index 00000000..72b84245
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png
new file mode 100644
index 00000000..bc49e4f4
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png
index 42c92516..42c92516 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/wifi.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png
index 8aa4c9a8..8aa4c9a8 100644
--- a/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Style/PageIndicator.qml b/examples/quickcontrols2/wearable/qml/Style/PageIndicator.qml
index 6a92c42f..81d4c9ef 100644
--- a/examples/quickcontrols2/wearable/qml/Style/PageIndicator.qml
+++ b/examples/quickcontrols2/wearable/qml/Style/PageIndicator.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.10
+import QtQuick.Templates 2.3 as T
import "."
T.PageIndicator {
@@ -67,7 +67,7 @@ T.PageIndicator {
implicitHeight: 8
radius: width / 2
- color: UIStyle.colorQtGray3
+ color: UIStyle.themeColorQtGray3
opacity: index === control.currentIndex ? 1.0 : 0.35
diff --git a/examples/quickcontrols2/wearable/qml/Style/Slider.qml b/examples/quickcontrols2/wearable/qml/Style/Slider.qml
index 86f28abe..cdff4aec 100644
--- a/examples/quickcontrols2/wearable/qml/Style/Slider.qml
+++ b/examples/quickcontrols2/wearable/qml/Style/Slider.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.10
+import QtQuick.Templates 2.3 as T
import "."
T.Slider {
@@ -66,14 +66,14 @@ T.Slider {
radius: 5
color: control.pressed ? "#f0f0f0" : "#f6f6f6"
- border.color: UIStyle.colorQtGray7
+ border.color: UIStyle.themeColorQtGray7
}
background: Rectangle {
y: (control.height - height) / 2
height: 4
radius: 2
- color: UIStyle.colorQtGray3
+ color: UIStyle.themeColorQtGray3
Rectangle {
width: control.visualPosition * parent.width
diff --git a/examples/quickcontrols2/wearable/qml/Style/Switch.qml b/examples/quickcontrols2/wearable/qml/Style/Switch.qml
index a1dad07a..b1597737 100644
--- a/examples/quickcontrols2/wearable/qml/Style/Switch.qml
+++ b/examples/quickcontrols2/wearable/qml/Style/Switch.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.10
+import QtQuick.Templates 2.3 as T
import "."
T.Switch {
@@ -65,7 +65,7 @@ T.Switch {
height: 26
radius: 13
- color: control.down ? UIStyle.colorQtGray6 : UIStyle.colorQtGray10
+ color: control.down ? UIStyle.themeColorQtGray6 : UIStyle.themeColorQtGray10
border.color: !control.checked ? "#999999"
: (control.down ? UIStyle.colorQtAuxGreen2
: UIStyle.colorQtAuxGreen1)
@@ -78,9 +78,9 @@ T.Switch {
background: Rectangle {
radius: 13
- color: control.checked ? UIStyle.colorQtAuxGreen2 : "#E6173D"
+ color: control.checked ? UIStyle.colorQtAuxGreen2 : UIStyle.colorRed
border.color: control.checked ? UIStyle.colorQtAuxGreen2
- : UIStyle.colorQtGray6
+ : UIStyle.themeColorQtGray6
}
}
diff --git a/examples/quickcontrols2/wearable/qml/Style/UIStyle.qml b/examples/quickcontrols2/wearable/qml/Style/UIStyle.qml
index 98971233..f4a5df69 100644
--- a/examples/quickcontrols2/wearable/qml/Style/UIStyle.qml
+++ b/examples/quickcontrols2/wearable/qml/Style/UIStyle.qml
@@ -48,7 +48,7 @@
**
****************************************************************************/
-import QtQuick 2.7
+import QtQuick 2.10
pragma Singleton
@@ -70,6 +70,9 @@ QtObject {
readonly property color colorQtAuxGreen1: "#21be2b"
readonly property color colorQtAuxGreen2: "#17a81a"
+ // Red
+ readonly property color colorRed: "#e6173d"
+
// Gray
readonly property color colorQtGray1: "#09102b"
readonly property color colorQtGray2: "#222840"
@@ -81,4 +84,24 @@ QtObject {
readonly property color colorQtGray8: "#b5b7bf"
readonly property color colorQtGray9: "#cecfd5"
readonly property color colorQtGray10: "#f3f3f4"
+
+ // Light/dark versions of the colors above.
+ // Some UI elements always use a specific color regardless of theme,
+ // which is why we have both sets: so that those elements don't need to hard-code the hex string.
+ readonly property color themeColorQtGray1: darkTheme ? colorQtGray10 : colorQtGray1
+ readonly property color themeColorQtGray2: darkTheme ? colorQtGray9 : colorQtGray2
+ readonly property color themeColorQtGray3: darkTheme ? colorQtGray8 : colorQtGray3
+ readonly property color themeColorQtGray4: darkTheme ? colorQtGray7 : colorQtGray4
+ readonly property color themeColorQtGray5: darkTheme ? colorQtGray6 : colorQtGray5
+ readonly property color themeColorQtGray6: darkTheme ? colorQtGray5 : colorQtGray6
+ readonly property color themeColorQtGray7: darkTheme ? colorQtGray4 : colorQtGray7
+ readonly property color themeColorQtGray8: darkTheme ? colorQtGray3 : colorQtGray8
+ readonly property color themeColorQtGray9: darkTheme ? colorQtGray2 : colorQtGray9
+ readonly property color themeColorQtGray10: darkTheme ? colorQtGray1 : colorQtGray10
+
+ property bool darkTheme: false
+
+ function themeImagePath(baseImagePath) {
+ return baseImagePath + (darkTheme ? "-dark" : "-light") + ".png"
+ }
}
diff --git a/examples/quickcontrols2/wearable/qml/SwipeViewPage.qml b/examples/quickcontrols2/wearable/qml/SwipeViewPage.qml
index 0a9ada57..6d4b687f 100644
--- a/examples/quickcontrols2/wearable/qml/SwipeViewPage.qml
+++ b/examples/quickcontrols2/wearable/qml/SwipeViewPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.1
+import QtQuick 2.10
+import QtQuick.Controls 2.2
Item {
// Don't show the item when the StackView that contains us
diff --git a/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml b/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml
index a02b44ee..256e60a4 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml
+++ b/examples/quickcontrols2/wearable/qml/Weather/WeatherPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import ".."
import "../Style"
import "weather.js" as WeatherData
@@ -69,7 +69,7 @@ Item {
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/temperature.png"
+ source: UIStyle.themeImagePath("images/temperature")
}
Column {
@@ -85,7 +85,7 @@ Item {
+ " °F" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -97,7 +97,7 @@ Item {
+ " °F" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -109,7 +109,7 @@ Item {
+ " °F " : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
}
@@ -129,7 +129,7 @@ Item {
Image {
id: wImg
anchors.verticalCenter: parent.verticalCenter
- source: "images/wind.png"
+ source: UIStyle.themeImagePath("images/wind")
}
Text {
@@ -141,7 +141,7 @@ Item {
+ " mph" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
@@ -152,7 +152,7 @@ Item {
Image {
id: hImg
anchors.verticalCenter: parent.verticalCenter
- source: "images/humidity.png"
+ source: UIStyle.themeImagePath("images/humidity")
}
Text {
@@ -164,7 +164,7 @@ Item {
+ " %" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
}
@@ -179,7 +179,7 @@ Item {
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/pressure.png"
+ source: UIStyle.themeImagePath("images/pressure")
}
Column {
@@ -195,7 +195,7 @@ Item {
+ " hPa" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -207,7 +207,7 @@ Item {
+ " hPa" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
Text {
@@ -219,7 +219,7 @@ Item {
+ " hPa" : "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
}
@@ -238,7 +238,7 @@ Item {
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/sunrise.png"
+ source: UIStyle.themeImagePath("images/sunrise")
}
Text {
@@ -250,7 +250,7 @@ Item {
: "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
@@ -260,7 +260,7 @@ Item {
Image {
anchors.verticalCenter: parent.verticalCenter
- source: "images/sunset.png"
+ source: UIStyle.themeImagePath("images/sunset")
}
Text {
@@ -272,7 +272,7 @@ Item {
: "N/A"
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 1
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
}
}
}
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark.png
new file mode 100644
index 00000000..6baaefda
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark@2x.png
new file mode 100644
index 00000000..7060c48d
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-light.png
index ef9ed9de..ef9ed9de 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/humidity.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-light@2x.png
index 5c367a3e..5c367a3e 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark.png
new file mode 100644
index 00000000..2038c695
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark@2x.png
new file mode 100644
index 00000000..9b5a4abe
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-light.png
index 7850609e..7850609e 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/pressure.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-light@2x.png
index 14c1cab3..14c1cab3 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark.png
new file mode 100644
index 00000000..5a70f984
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark@2x.png
new file mode 100644
index 00000000..2baa7135
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light.png
index 70a9a969..70a9a969 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light@2x.png
index 3a7892eb..3a7892eb 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark.png
new file mode 100644
index 00000000..5dde7c0f
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark@2x.png
new file mode 100644
index 00000000..3892c2ea
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-light.png
index 01bb9ec8..01bb9ec8 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/sunset.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-light@2x.png
index 39aeebe5..39aeebe5 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark.png
new file mode 100644
index 00000000..1c86bae2
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark@2x.png
new file mode 100644
index 00000000..c1ac7d66
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-light.png
index 5d7faa99..5d7faa99 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/temperature.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-light@2x.png
index 0b4340ce..0b4340ce 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark.png
new file mode 100644
index 00000000..4e5264a3
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark@2x.png
new file mode 100644
index 00000000..0a893d50
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind-dark@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind-light.png
index c728fcc0..c728fcc0 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/wind.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind-light.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind-light@2x.png
index bab49c04..bab49c04 100644
--- a/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind-light@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/Clock.qml b/examples/quickcontrols2/wearable/qml/WorldClock/Clock.qml
index e3da38c7..158f3d70 100644
--- a/examples/quickcontrols2/wearable/qml/WorldClock/Clock.qml
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/Clock.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import ".."
import "../Style"
@@ -180,7 +180,7 @@ SwipeViewPage {
anchors.horizontalCenter: parent.horizontalCenter
text: cityName
- color: UIStyle.colorQtGray1
+ color: UIStyle.themeColorQtGray1
font.pixelSize: UIStyle.fontSizeXS
font.letterSpacing: 2
}
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/WorldClockPage.qml b/examples/quickcontrols2/wearable/qml/WorldClock/WorldClockPage.qml
index cdf96bf2..1456072f 100644
--- a/examples/quickcontrols2/wearable/qml/WorldClock/WorldClockPage.qml
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/WorldClockPage.qml
@@ -48,8 +48,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
import "../Style"
Item {
diff --git a/examples/quickcontrols2/wearable/wearable.cpp b/examples/quickcontrols2/wearable/wearable.cpp
index e90ec413..68dee7c0 100644
--- a/examples/quickcontrols2/wearable/wearable.cpp
+++ b/examples/quickcontrols2/wearable/wearable.cpp
@@ -56,6 +56,9 @@
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QCoreApplication::setApplicationName("Wearable");
+ QCoreApplication::setOrganizationName("QtProject");
+
QGuiApplication app(argc, argv);
//! [style]
diff --git a/examples/quickcontrols2/wearable/wearable.qml b/examples/quickcontrols2/wearable/wearable.qml
index 01d52b12..ea84adca 100644
--- a/examples/quickcontrols2/wearable/wearable.qml
+++ b/examples/quickcontrols2/wearable/wearable.qml
@@ -48,23 +48,41 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Controls 2.0 as QQC2
+import QtQuick 2.10
+import QtQuick.Controls 2.3 as QQC2
+import Qt.labs.settings 1.0
import "qml"
import "qml/Style"
QQC2.ApplicationWindow {
id: window
-
visible: true
-
width: 320
height: 320
-
title: qsTr("Wearable")
+ Settings {
+ id: settings
+ property bool wireless
+ property bool bluetooth
+ property int brightness
+ property bool darkTheme
+ property bool demoMode
+ }
+
+ Binding {
+ target: UIStyle
+ property: "darkTheme"
+ value: settings.darkTheme
+ }
+
+ // We need the settings object both here and in SettingsPage,
+ // so for convenience, we declare it as a property of the root object so that
+ // it will be available to all of the QML files that we load.
+ property alias settings: settings
+
background: Image {
- source: "images/background.png"
+ source: "images/background-" + (settings.darkTheme ? "dark" : "light") + ".png"
}
header: NaviButton {
@@ -97,4 +115,26 @@ QQC2.ApplicationWindow {
onLaunched: stackView.push(page)
}
}
+
+ DemoMode {
+ stackView: stackView
+ }
+
+ DemoModeIndicator {
+ id: demoModeIndicator
+ y: settings.demoMode ? -height : -height * 2
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: header.height
+ z: window.header.z + 1
+ }
+
+ MouseArea {
+ enabled: settings.demoMode
+ anchors.fill: parent
+ onClicked: {
+ // Stop demo mode and return to the launcher page.
+ settings.demoMode = false
+ stackView.pop(null)
+ }
+ }
}
diff --git a/examples/quickcontrols2/wearable/wearable.qrc b/examples/quickcontrols2/wearable/wearable.qrc
index d71b5bab..db59d038 100644
--- a/examples/quickcontrols2/wearable/wearable.qrc
+++ b/examples/quickcontrols2/wearable/wearable.qrc
@@ -18,7 +18,8 @@
<file>icons/wearable/36x36@2/settings.png</file>
<file>icons/wearable/36x36@2/weather.png</file>
<file>icons/wearable/36x36@2/worldclock.png</file>
- <file>images/background.png</file>
+ <file>images/background-light.png</file>
+ <file>images/background-dark.png</file>
<file>images/back.png</file>
<file>images/back@2x.png</file>
<file>images/home.png</file>
@@ -26,45 +27,77 @@
<file>qml/Alarms/AlarmsPage.qml</file>
<file>qml/Fitness/fitness.js</file>
<file>qml/Fitness/FitnessPage.qml</file>
- <file>qml/Fitness/images/man-running.png</file>
- <file>qml/Fitness/images/man-running@2x.png</file>
- <file>qml/Fitness/images/man-walking.png</file>
- <file>qml/Fitness/images/man-walking@2x.png</file>
+ <file>qml/Fitness/images/man-running-light.png</file>
+ <file>qml/Fitness/images/man-running-light@2x.png</file>
+ <file>qml/Fitness/images/man-walking-light.png</file>
+ <file>qml/Fitness/images/man-walking-light@2x.png</file>
+ <file>qml/Fitness/images/man-running-dark.png</file>
+ <file>qml/Fitness/images/man-running-dark@2x.png</file>
+ <file>qml/Fitness/images/man-walking-dark.png</file>
+ <file>qml/Fitness/images/man-walking-dark@2x.png</file>
<file>qml/Navigation/navigation.js</file>
<file>qml/Navigation/NavigationPage.qml</file>
<file>qml/Navigation/RouteElement.qml</file>
<file>qml/Navigation/walk_route.json</file>
<file>qml/Navigation/images/end.png</file>
<file>qml/Navigation/images/end@2x.png</file>
- <file>qml/Navigation/images/leftturn.png</file>
- <file>qml/Navigation/images/leftturn@2x.png</file>
- <file>qml/Navigation/images/navigation.png</file>
- <file>qml/Navigation/images/navigation@2x.png</file>
- <file>qml/Navigation/images/rightturn.png</file>
- <file>qml/Navigation/images/rightturn@2x.png</file>
+ <file>qml/Navigation/images/leftturn-light.png</file>
+ <file>qml/Navigation/images/leftturn-light@2x.png</file>
+ <file>qml/Navigation/images/leftturn-dark.png</file>
+ <file>qml/Navigation/images/leftturn-dark@2x.png</file>
+ <file>qml/Navigation/images/navigation-light.png</file>
+ <file>qml/Navigation/images/navigation-light@2x.png</file>
+ <file>qml/Navigation/images/navigation-dark.png</file>
+ <file>qml/Navigation/images/navigation-dark@2x.png</file>
+ <file>qml/Navigation/images/rightturn-light.png</file>
+ <file>qml/Navigation/images/rightturn-light@2x.png</file>
+ <file>qml/Navigation/images/rightturn-dark.png</file>
+ <file>qml/Navigation/images/rightturn-dark@2x.png</file>
<file>qml/Navigation/images/start.png</file>
<file>qml/Navigation/images/start@2x.png</file>
- <file>qml/Navigation/images/straight.png</file>
- <file>qml/Navigation/images/straight@2x.png</file>
+ <file>qml/Navigation/images/straight-light.png</file>
+ <file>qml/Navigation/images/straight-light@2x.png</file>
+ <file>qml/Navigation/images/straight-dark.png</file>
+ <file>qml/Navigation/images/straight-dark@2x.png</file>
<file>qml/Navigation/images/uturn.png</file>
<file>qml/Navigation/images/uturn@2x.png</file>
<file>qml/Notifications/notifications.js</file>
<file>qml/Notifications/NotificationsPage.qml</file>
- <file>qml/Notifications/images/avatarf.png</file>
- <file>qml/Notifications/images/avatarf@2x.png</file>
- <file>qml/Notifications/images/avatarm.png</file>
- <file>qml/Notifications/images/avatarm@2x.png</file>
- <file>qml/Notifications/images/missedcall.png</file>
- <file>qml/Notifications/images/missedcall@2x.png</file>
+ <file>qml/Notifications/images/avatarf-light.png</file>
+ <file>qml/Notifications/images/avatarf-light@2x.png</file>
+ <file>qml/Notifications/images/avatarm-light.png</file>
+ <file>qml/Notifications/images/avatarm-light@2x.png</file>
+ <file>qml/Notifications/images/missedcall-light.png</file>
+ <file>qml/Notifications/images/missedcall-light@2x.png</file>
+ <file>qml/Notifications/images/avatarf-dark.png</file>
+ <file>qml/Notifications/images/avatarf-dark@2x.png</file>
+ <file>qml/Notifications/images/avatarm-dark.png</file>
+ <file>qml/Notifications/images/avatarm-dark@2x.png</file>
+ <file>qml/Notifications/images/missedcall-dark.png</file>
+ <file>qml/Notifications/images/missedcall-dark@2x.png</file>
<file>qml/Settings/SettingsPage.qml</file>
- <file>qml/Settings/images/bluetooth.png</file>
- <file>qml/Settings/images/bluetooth@2x.png</file>
- <file>qml/Settings/images/brightness.png</file>
- <file>qml/Settings/images/brightness@2x.png</file>
- <file>qml/Settings/images/contrast.png</file>
- <file>qml/Settings/images/contrast@2x.png</file>
- <file>qml/Settings/images/wifi.png</file>
- <file>qml/Settings/images/wifi@2x.png</file>
+ <file>qml/Settings/images/bluetooth-light.png</file>
+ <file>qml/Settings/images/bluetooth-light@2x.png</file>
+ <file>qml/Settings/images/brightness-light.png</file>
+ <file>qml/Settings/images/brightness-light@2x.png</file>
+ <file>qml/Settings/images/demo-mode-light.png</file>
+ <file>qml/Settings/images/demo-mode-light@2x.png</file>
+ <file>qml/Settings/images/demo-mode-dark.png</file>
+ <file>qml/Settings/images/demo-mode-dark@2x.png</file>
+ <file>qml/Settings/images/demo-mode-white.png</file>
+ <file>qml/Settings/images/demo-mode-white@2x.png</file>
+ <file>qml/Settings/images/theme-light.png</file>
+ <file>qml/Settings/images/theme-light@2x.png</file>
+ <file>qml/Settings/images/wifi-light.png</file>
+ <file>qml/Settings/images/wifi-light@2x.png</file>
+ <file>qml/Settings/images/bluetooth-dark.png</file>
+ <file>qml/Settings/images/bluetooth-dark@2x.png</file>
+ <file>qml/Settings/images/brightness-dark.png</file>
+ <file>qml/Settings/images/brightness-dark@2x.png</file>
+ <file>qml/Settings/images/theme-dark.png</file>
+ <file>qml/Settings/images/theme-dark@2x.png</file>
+ <file>qml/Settings/images/wifi-dark.png</file>
+ <file>qml/Settings/images/wifi-dark@2x.png</file>
<file>qml/Style/qmldir</file>
<file>qml/Style/PageIndicator.qml</file>
<file>qml/Style/Slider.qml</file>
@@ -73,18 +106,30 @@
<file>qml/Weather/weather.js</file>
<file>qml/Weather/weather.json</file>
<file>qml/Weather/WeatherPage.qml</file>
- <file>qml/Weather/images/humidity.png</file>
- <file>qml/Weather/images/humidity@2x.png</file>
- <file>qml/Weather/images/pressure.png</file>
- <file>qml/Weather/images/pressure@2x.png</file>
- <file>qml/Weather/images/sunrise.png</file>
- <file>qml/Weather/images/sunrise@2x.png</file>
- <file>qml/Weather/images/sunset.png</file>
- <file>qml/Weather/images/sunset@2x.png</file>
- <file>qml/Weather/images/temperature.png</file>
- <file>qml/Weather/images/temperature@2x.png</file>
- <file>qml/Weather/images/wind.png</file>
- <file>qml/Weather/images/wind@2x.png</file>
+ <file>qml/Weather/images/humidity-light.png</file>
+ <file>qml/Weather/images/humidity-light@2x.png</file>
+ <file>qml/Weather/images/pressure-light.png</file>
+ <file>qml/Weather/images/pressure-light@2x.png</file>
+ <file>qml/Weather/images/sunrise-light.png</file>
+ <file>qml/Weather/images/sunrise-light@2x.png</file>
+ <file>qml/Weather/images/sunset-light.png</file>
+ <file>qml/Weather/images/sunset-light@2x.png</file>
+ <file>qml/Weather/images/temperature-light.png</file>
+ <file>qml/Weather/images/temperature-light@2x.png</file>
+ <file>qml/Weather/images/wind-light.png</file>
+ <file>qml/Weather/images/wind-light@2x.png</file>
+ <file>qml/Weather/images/humidity-dark.png</file>
+ <file>qml/Weather/images/humidity-dark@2x.png</file>
+ <file>qml/Weather/images/pressure-dark.png</file>
+ <file>qml/Weather/images/pressure-dark@2x.png</file>
+ <file>qml/Weather/images/sunrise-dark.png</file>
+ <file>qml/Weather/images/sunrise-dark@2x.png</file>
+ <file>qml/Weather/images/sunset-dark.png</file>
+ <file>qml/Weather/images/sunset-dark@2x.png</file>
+ <file>qml/Weather/images/temperature-dark.png</file>
+ <file>qml/Weather/images/temperature-dark@2x.png</file>
+ <file>qml/Weather/images/wind-dark.png</file>
+ <file>qml/Weather/images/wind-dark@2x.png</file>
<file>qml/WorldClock/Clock.qml</file>
<file>qml/WorldClock/WorldClockPage.qml</file>
<file>qml/WorldClock/images/center.png</file>
@@ -104,5 +149,7 @@
<file>qml/WorldClock/images/swissnightminute.png</file>
<file>qml/WorldClock/images/swissnightminute@2x.png</file>
<file>qml/SwipeViewPage.qml</file>
+ <file>qml/DemoMode.qml</file>
+ <file>qml/DemoModeIndicator.qml</file>
</qresource>
</RCC>