diff options
Diffstat (limited to 'examples/quickcontrols2/wearable/qml/Settings')
25 files changed, 353 insertions, 0 deletions
diff --git a/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml new file mode 100644 index 0000000000..347ad417e4 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/SettingsPage.qml @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick +import QtQuick.Controls as QQC2 +import ".." +import "../Style" + +Item { + + QQC2.SwipeView { + id: svSettingsContainer + + anchors.fill: parent + + SwipeViewPage { + id: settingsPage1 + + property alias bluetoothSwitch: bluetoothSwitch + property alias wirelessSwitch: wirelessSwitch + + Column { + anchors.centerIn: parent + spacing: 25 + + Row { + spacing: 50 + Image { + anchors.verticalCenter: parent.verticalCenter + 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: UIStyle.themeImagePath("images/wifi") + } + QQC2.Switch { + id: wirelessSwitch + anchors.verticalCenter: parent.verticalCenter + checked: settings.wireless + onToggled: settings.wireless = checked + } + } + } + } + + SwipeViewPage { + id: settingsPage2 + + property alias brightnessSlider: brightnessSlider + property alias darkThemeSwitch: darkThemeSwitch + + Column { + anchors.centerIn: parent + spacing: 2 + + Column { + Image { + anchors.horizontalCenter: parent.horizontalCenter + source: UIStyle.themeImagePath("images/brightness") + } + QQC2.Slider { + id: brightnessSlider + anchors.horizontalCenter: parent.horizontalCenter + from: 0 + to: 5 + stepSize: 1 + value: settings.brightness + onMoved: settings.brightness = value + } + } + Column { + anchors.horizontalCenter: parent.horizontalCenter + + Image { + anchors.horizontalCenter: parent.horizontalCenter + source: UIStyle.themeImagePath("images/theme") + } + QQC2.Switch { + id: darkThemeSwitch + anchors.horizontalCenter: parent.horizontalCenter + 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 + } + } + } + } + } + + QQC2.PageIndicator { + count: svSettingsContainer.count + currentIndex: svSettingsContainer.currentIndex + + anchors.bottom: svSettingsContainer.bottom + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png Binary files differnew file mode 100644 index 0000000000..0f1f4d0a54 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png Binary files differnew file mode 100644 index 0000000000..7496fc5685 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-dark@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png Binary files differnew file mode 100644 index 0000000000..6e297cfab3 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png Binary files differnew file mode 100644 index 0000000000..62d084032f --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth-light@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png Binary files differnew file mode 100644 index 0000000000..f9eb07b583 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png Binary files differnew file mode 100644 index 0000000000..3efc5a6c4b --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-dark@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png Binary files differnew file mode 100644 index 0000000000..ce3023b565 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png Binary files differnew file mode 100644 index 0000000000..dc01aae1fd --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness-light@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png Binary files differnew file mode 100644 index 0000000000..e93c417d79 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark.png 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 Binary files differnew file mode 100644 index 0000000000..faa1bf6d11 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-dark@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png Binary files differnew file mode 100644 index 0000000000..c38d146d37 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light.png 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 Binary files differnew file mode 100644 index 0000000000..b9d6409cbc --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-light@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png Binary files differnew file mode 100644 index 0000000000..aac8ef3f6c --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white.png 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 Binary files differnew file mode 100644 index 0000000000..b4d8954f5d --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/demo-mode-white@2x.png 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 0000000000..ad1ce44873 --- /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 Binary files differnew file mode 100644 index 0000000000..d4c4a8c094 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png Binary files differnew file mode 100644 index 0000000000..30d8c6de28 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-dark@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png Binary files differnew file mode 100644 index 0000000000..e7a0771b94 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png Binary files differnew file mode 100644 index 0000000000..83bc878b03 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/theme-light@2x.png 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 0000000000..bf3f1e57d7 --- /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 Binary files differnew file mode 100644 index 0000000000..14bfe8f5c8 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png Binary files differnew file mode 100644 index 0000000000..b70d04290b --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-dark@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png Binary files differnew file mode 100644 index 0000000000..2de34118a7 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png Binary files differnew file mode 100644 index 0000000000..64b5f1725c --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi-light@2x.png |