diff options
Diffstat (limited to 'sample-qml/imports')
30 files changed, 0 insertions, 994 deletions
diff --git a/sample-qml/imports/components/AwesomeIcon.qml b/sample-qml/imports/components/AwesomeIcon.qml deleted file mode 100644 index 542fb0f..0000000 --- a/sample-qml/imports/components/AwesomeIcon.qml +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import QtQuick 2.0
-import system 1.0
-import components 1.0
-import utils 1.0
-
-Item {
- height: icon.height
- width: icon.height
-
- property alias iconSize: icon.font.pixelSize
- property alias ucKey: icon.text
- property alias iconColor: icon.color
-
- Text {
- id: icon
- font.family: "FontAwesome"
- color: "white"
- }
-}
-
diff --git a/sample-qml/imports/components/Box.qml b/sample-qml/imports/components/Box.qml deleted file mode 100644 index a2f2ae0..0000000 --- a/sample-qml/imports/components/Box.qml +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import utils 1.0 - -Item { - id: root - - opacity: 0.8 - property color color: Style.grey - property color border: color - property string shadow: "" - - OutShadow { - color: root.color - visible: root.shadow === "out" - } - - Rectangle { - id: rect - anchors.fill: parent - color: Style.black - border.width: 1 - border.color: root.border - } - - InsetShadow { - color: root.color - visible: root.shadow === "fill" - } - - InShadow { - color: root.color - visible: root.shadow === "in" - } - - Rectangle { - visible: root.shadow === "fill" - anchors.fill: parent - color: "transparent" - border.width: 1 - border.color: root.border - } - -} diff --git a/sample-qml/imports/components/BoxButton.qml b/sample-qml/imports/components/BoxButton.qml deleted file mode 100644 index 0969f46..0000000 --- a/sample-qml/imports/components/BoxButton.qml +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import components 1.0 - -Item { - id: root - - property alias shadow: box.shadow - property alias color: box.color - property alias text: textItem.text - - signal clicked() - - Box { - id: box - anchors.fill: parent - - Text { - id: textItem - anchors.centerIn: parent - horizontalAlignment: Text.AlignHCenter - font.pixelSize: 28 - color: "white" - } - - MouseArea { - anchors.fill: parent - onClicked: root.clicked() - } - } -} diff --git a/sample-qml/imports/components/BoxHeading.qml b/sample-qml/imports/components/BoxHeading.qml deleted file mode 100644 index bb2c62a..0000000 --- a/sample-qml/imports/components/BoxHeading.qml +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import utils 1.0 - -Row { - id: root - - property color color: Style.blueViv - property alias fontSize: headingText.font.pixelSize - property alias text: headingText.text - property alias boxWidth: box.width - property alias boxHeight: box.height - - spacing: 10 - - Rectangle { - id: box - anchors.bottom: headingText.baseline - anchors.bottomMargin: 0 - width: 100 - height: 16 - color: root.color - } - - Text { - id: headingText - font.family: "Source Sans Pro" - font.pixelSize: 22 - font.weight: Font.Bold - color: root.color - } -} diff --git a/sample-qml/imports/components/Button.qml b/sample-qml/imports/components/Button.qml deleted file mode 100644 index 9d5c495..0000000 --- a/sample-qml/imports/components/Button.qml +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 - -Rectangle { - id: root - border.color: "#cccccc" - color:"#222" - border.width: 2 - height: pairText.height + 20 - width: pairText.width + 20 - - property string buttonText - - - Text { - id: pairText - anchors.centerIn: parent - font.family: "Source Sans Pro" - font.pixelSize: 48 - font.weight: Font.Bold - color: "white" - font.capitalization: Font.AllUppercase - text: buttonText - } -} diff --git a/sample-qml/imports/components/DateTime.qml b/sample-qml/imports/components/DateTime.qml deleted file mode 100644 index 6203712..0000000 --- a/sample-qml/imports/components/DateTime.qml +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import QtQuick 2.0
-import utils 1.0
-
-Item {
- id: dateTime
- anchors.left: parent.left
- anchors.right: parent.right
- height: 120
- property var timeStamp: new Date()
-
- Timer {
- interval: 1000
- running: true
- repeat: true
- onTriggered: timeStamp = new Date()
- }
-
- Label {
- fontColor: Style.grey
- text: Qt.formatDate(timeStamp, "ddd MMM d")
- }
-
- Label {
- anchors.right: parent.right
- fontColor: Style.grey
- text: Qt.formatTime(timeStamp, "h:mm AP")
- }
-}
-
diff --git a/sample-qml/imports/components/HexGrid.qml b/sample-qml/imports/components/HexGrid.qml deleted file mode 100644 index b81a09a..0000000 --- a/sample-qml/imports/components/HexGrid.qml +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 - -Item { - property real spacing: 0 - property int columns: 3 - - width: childrenRect.width - height: childrenRect.height - - Component.onCompleted: { - var sizeX = childrenRect.height - var sizeY = childrenRect.width - var column = 0 - var row = 0 - - for (var n = 0; n < children.length; n++) { - children[n].x = column * (sizeX + spacing) - children[n].y = row * (0.5 * sizeY + spacing) - column += 2 - if (column >= columns) { - row++ - column = row % 2 - } - } - } -} diff --git a/sample-qml/imports/components/HexSwitch.qml b/sample-qml/imports/components/HexSwitch.qml deleted file mode 100644 index d0b7909..0000000 --- a/sample-qml/imports/components/HexSwitch.qml +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import QtGraphicalEffects 1.0 - -Item { - width: 170 * height / 80 - height: 80 - - property bool value - property bool showLabels: false - - Image { - anchors.fill: parent - source: "../../images/switchplate_" + (value ? "on" : "off") + ".png" - } - - Item { - id: shadowTarget - x: value ? parent.width * 0.375 : -11 - width: parent.width * 0.7 - height: parent.height - - Image { - id: control - anchors.centerIn: parent - width: parent.height * 0.9 - fillMode: Image.PreserveAspectFit - source: "../../images/switchcontrol.png" - } - } - - DropShadow { - anchors.fill: shadowTarget - cached: true - horizontalOffset: parent.height * 0.05 - verticalOffset: parent.height * 0.05 - radius: 16 - samples: 32 - color: Qt.rgba(0, 0, 0, 0.35) - smooth: true - source: shadowTarget - } - - Text { - text: qsTr("OFF") - font.family: "Source Sans Pro" - anchors.right: parent.left - anchors.rightMargin: 30 - anchors.verticalCenter: parent.verticalCenter - font.pointSize: 25 - font.letterSpacing: -0.5 - font.weight: value ? Font.Normal : Font.Bold - color: value ? "#C4C4C4" : "#FE9C00" - visible: showLabels - } - - Text { - id: onText - text: qsTr("ON") - font.family: "Source Sans Pro" - anchors.left: parent.right - anchors.leftMargin: 30 - font.pointSize: 25 - anchors.verticalCenter: parent.verticalCenter - font.letterSpacing: -0.5 - font.weight: value ? Font.Bold : Font.Normal - color: value ? "#59FF00" : "#C4C4C4" - visible: showLabels - } - - MouseArea { - anchors.fill: parent - onClicked: value = !value - } -} diff --git a/sample-qml/imports/components/InShadow.qml b/sample-qml/imports/components/InShadow.qml deleted file mode 100644 index 2d64c2a..0000000 --- a/sample-qml/imports/components/InShadow.qml +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 - -ShaderEffect { - anchors.fill: parent - property color color - property real radius: 16 - - fragmentShader: " -uniform lowp float radius; -uniform lowp float height; -uniform lowp float width; -uniform lowp float qt_Opacity; -uniform lowp vec4 color; -varying highp vec2 qt_TexCoord0; - -void main(void) { - lowp vec2 dist = min(qt_TexCoord0, vec2(1.0) - qt_TexCoord0); - // Border shadow - lowp float xval = smoothstep(0.0, radius, dist.x * width); - lowp float yval = smoothstep(0.0, radius, dist.y * height); - lowp float borderVal = sqrt(yval * xval) * 0.5 + 0.5; - - lowp vec4 borderColor = mix(color, vec4(0.0, 0.0, 0.0, 1.0), borderVal); - gl_FragColor = borderColor * qt_Opacity; -} - " -} diff --git a/sample-qml/imports/components/InsetShadow.qml b/sample-qml/imports/components/InsetShadow.qml deleted file mode 100644 index 6ad17cd..0000000 --- a/sample-qml/imports/components/InsetShadow.qml +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 - -ShaderEffect { - anchors.fill: parent - property color color - property real radius: 100 - property real border: 20 - - fragmentShader: " -uniform lowp float radius; -uniform lowp float border; -uniform lowp float height; -uniform lowp float width; -uniform lowp float qt_Opacity; -uniform lowp vec4 color; -varying highp vec2 qt_TexCoord0; - -void main(void) { - lowp vec2 dist = min(qt_TexCoord0, vec2(1.0) - qt_TexCoord0); - // Border shadow - lowp float xval = smoothstep(0.0, border, dist.x * width); - lowp float yval = smoothstep(0.0, border, dist.y * height); - lowp float borderVal = sqrt(yval * xval) * 0.5 + 0.5; - // Inner shadow - xval = smoothstep(0.0, radius, dist.x * width); - yval = smoothstep(0.0, radius, dist.y * width); - lowp float innerVal = sqrt(yval * xval) * 0.5 + 0.5; - - lowp vec4 innerColor = mix(vec4(0.0, 0.0, 0.0, 0.5), color, innerVal); - lowp vec4 borderColor = mix(vec4(0.0, 0.0, 0.0, 1.0), innerColor, borderVal); - gl_FragColor = borderColor * qt_Opacity; -} - " -} diff --git a/sample-qml/imports/components/Label.qml b/sample-qml/imports/components/Label.qml deleted file mode 100644 index e1e0b30..0000000 --- a/sample-qml/imports/components/Label.qml +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import QtQuick 2.0
-import utils 1.0
-
-Item {
- // Tracer {}
- width: childrenRect.width
- height: childrenRect.height
- property alias text: text.text
- property alias label: text
- property alias fontSize: text.font.pixelSize
- property alias fontColor: text.color
-
- Text {
- id: text
- color: "#ddd"
- font.family: "Source Sans Pro"
- font.pixelSize: 40
- font.capitalization: Font.AllUppercase
- font.weight: Font.Bold
- }
-}
diff --git a/sample-qml/imports/components/NumberPad.qml b/sample-qml/imports/components/NumberPad.qml deleted file mode 100644 index b7763ca..0000000 --- a/sample-qml/imports/components/NumberPad.qml +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-import QtQuick 2.0
-import utils 1.0
-
-Item {
- id: root
- height: childrenRect.height
- property var letters: ["","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"]
- property var bottomRow: ["*","0","#"]
-
- signal number(string number)
-
- Grid {
- id: numberGrid
- columns: 3
- spacing: 20
-
- Repeater {
- model: 9
- delegate: Item {
- id: numberKey
- width: (root.width - ( numberGrid.spacing*(numberGrid.columns-1)))/numberGrid.columns
- height: numberKey.width * 0.8
- anchors.margins: 10
-
- Rectangle {
- id: shadowTarget
- anchors.fill: parent
- border.width: 1
- border.color: "white"
- color: "#6653b5ce"
- }
-
- Item {
- height: childrenRect.height
- width: parent.width
- anchors.centerIn: parent
-
- Label {
- anchors.horizontalCenter: parent.horizontalCenter
- id: keypadNumber
- text: index + 1
- }
-
- Label {
- anchors.horizontalCenter: parent.horizontalCenter
- id: keypadLetters
- anchors.top: keypadNumber.bottom
- fontSize: 30
- fontColor: "#53b5ce"
- text: letters[index]
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.number(keypadNumber.text)
- }
- }
- }
-
- Repeater {
- model: 3
- delegate: Item {
- width: (root.width - ( numberGrid.spacing*(numberGrid.columns-1)))/numberGrid.columns
- height: width * 0.8
- anchors.margins: 10
-
- Rectangle {
- id: shadowTarget
- anchors.fill: parent
- border.width: 1
- border.color: "white"
- color: "#6653b5ce"
- }
-
- Item {
- height: childrenRect.height
- width: parent.width
- anchors.centerIn: parent
-
- Label {
- anchors.horizontalCenter: parent.horizontalCenter
- id: keypadNumber
- text: bottomRow[index]
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.number(keypadNumber.text)
- }
- }
- }
- }
-}
diff --git a/sample-qml/imports/components/OutShadow.qml b/sample-qml/imports/components/OutShadow.qml deleted file mode 100644 index f4d8407..0000000 --- a/sample-qml/imports/components/OutShadow.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import QtGraphicalEffects 1.0 - -Item { - id: root - - anchors.fill: parent - property alias color: shadow.color - property alias radius: shadow.radius - - Item { - id: shadowTarget - x: -radius - y: -radius - width: parent.width + 2 * radius - height: parent.height + 2 * radius - - Rectangle { - anchors.centerIn: parent - width: root.width - height: root.height - color: "black" - } - } - - DropShadow { - id: shadow - anchors.fill: shadowTarget - horizontalOffset: 0 - verticalOffset: 0 - radius: 16 - samples: 32 - source: shadowTarget - } -} diff --git a/sample-qml/imports/components/Switch.qml b/sample-qml/imports/components/Switch.qml deleted file mode 100644 index 6cd50c7..0000000 --- a/sample-qml/imports/components/Switch.qml +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 - -Switch { - width: 100 - height: 62 -} - diff --git a/sample-qml/imports/components/qmldir b/sample-qml/imports/components/qmldir deleted file mode 100644 index 57e4d2d..0000000 --- a/sample-qml/imports/components/qmldir +++ /dev/null @@ -1,16 +0,0 @@ -#/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. -# * -# * This Source Code Form is subject to the terms of the Mozilla Public -# * License, v. 2.0. If a copy of the MPL was not distributed with this -# * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -AwesomeIcon 1.0 AwesomeIcon.qml -Box 1.0 Box.qml -BoxButton 1.0 BoxButton.qml -BoxHeading 1.0 BoxHeading.qml -DateTime 1.0 DateTime.qml -HexGrid 1.0 HexGrid.qml -HexSwitch 1.0 HexSwitch.qml -Label 1.0 Label.qml -NumberPad 1.0 NumberPad.qml -Button 1.0 Button.qml diff --git a/sample-qml/imports/radio/Radio.qml b/sample-qml/imports/radio/Radio.qml deleted file mode 100644 index cea2e1a..0000000 --- a/sample-qml/imports/radio/Radio.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.0 - -Item { - signal stopped - signal playing -} diff --git a/sample-qml/imports/radio/qmldir b/sample-qml/imports/radio/qmldir deleted file mode 100644 index e334188..0000000 --- a/sample-qml/imports/radio/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -Radio 1.0 Radio.qml -RadioPropertyItem 1.0 Radio.qml diff --git a/sample-qml/imports/system/App.qml b/sample-qml/imports/system/App.qml deleted file mode 100644 index d99e7f8..0000000 --- a/sample-qml/imports/system/App.qml +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import system 1.0 - -FocusScope { - id: root - property string appId - width: 1080 - height: 1920 - visible: true - property bool hasKeyFocus: false - focus: visible - onFocusChanged: if (focus) hasKeyFocus = true - - Rectangle{ - anchors.fill: parent - color: 'black' - } - - Keys.onPressed: { - switch (event.key) { - case Qt.Key_Left: - case Qt.Key_Right: - root.hasKeyFocus = false - break - default: - break - } - } -} diff --git a/sample-qml/imports/system/App.qml.org b/sample-qml/imports/system/App.qml.org deleted file mode 100644 index d7da73c..0000000 --- a/sample-qml/imports/system/App.qml.org +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import system 1.0 - -FocusScope { - id: root - property string appId - anchors.fill: parent - visible: System.activeApp === appId - property bool hasKeyFocus: false - focus: visible - onFocusChanged: if (focus) hasKeyFocus = true - - Keys.onPressed: { - switch (event.key) { - case Qt.Key_Left: - case Qt.Key_Right: - root.hasKeyFocus = false - break - default: - break - } - } -} diff --git a/sample-qml/imports/system/System.qml b/sample-qml/imports/system/System.qml deleted file mode 100644 index 8e155fd..0000000 --- a/sample-qml/imports/system/System.qml +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton -import QtQuick 2.0 - -Item { - property string activeApp: "home" - property string activeSetting: "settings" - property bool showKeyboard: false - property bool showSettings: false -} diff --git a/sample-qml/imports/system/qmldir b/sample-qml/imports/system/qmldir deleted file mode 100644 index afa0f56..0000000 --- a/sample-qml/imports/system/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -#/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. -# * -# * This Source Code Form is subject to the terms of the Mozilla Public -# * License, v. 2.0. If a copy of the MPL was not distributed with this -# * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -singleton System 1.0 System.qml -App 1.0 App.qml diff --git a/sample-qml/imports/utils/Marker.qml b/sample-qml/imports/utils/Marker.qml deleted file mode 100644 index c7a377e..0000000 --- a/sample-qml/imports/utils/Marker.qml +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import QtQuick 2.0 -import utils 1.0 - -Item { - id: root - width: 120 - height: 120 - property string text - signal clicked() - property alias pressed: area.pressed - property alias color: background.color - property alias fontSize: label.font.pixelSize - property bool fill: false - - Rectangle { - id: background - anchors.fill: parent - color: Style.backgroundColor - opacity: root.fill ? 1.0: 0.2 - } - - Rectangle { - id: frame - anchors.fill: parent - color: 'transparent' - border.color: Qt.darker(background.color, 1.4) - border.width: 2 - opacity: 1.0 - } - - - Rectangle { - anchors.fill: label - anchors.margins: -2 - color: Style.backgroundColor - opacity: root.text ? 1.0 : 0.0 - } - - Text { - id: label - anchors.centerIn: parent - font.pixelSize: 14 - color: Style.greyDarkColor - opacity: 0.75 - text: root.text - } - MouseArea { - id: area - anchors.fill: parent - onClicked: root.clicked() - onPressed: background.color = Qt.darker(background.color, 1.5) - onReleased: background.color = Qt.lighter(background.color, 1.5) - } -} diff --git a/sample-qml/imports/utils/Style.qml b/sample-qml/imports/utils/Style.qml deleted file mode 100644 index f9d9c16..0000000 --- a/sample-qml/imports/utils/Style.qml +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton -import QtQuick 2.2 - -QtObject { - property bool debugMode: false - property bool debugFill: false - - // Primary colors - property color orangeLt: "#ffd38c" - property color orangeViv: "#fe9c00" - property color blueLt: "#b2f0ff" - property color blueViv: "#53b5ce" - // Secondary colors - property color yellowLt: "#ffffb2" - property color yellowViv: "#ffff00" - property color greenLt: "#cdffb2" - property color greenViv: "#59ff00" - // Neutral colors - property color white: "#ffffff" - property color grey: "#c4c4c4" - property color black: "#000000" - property color overlay: Qt.rgba(0, 0, 0, 0.8) - - function getGfxPath() { - return Qt.resolvedUrl("../assets/") - } - - function gfx(name) { - return Qt.resolvedUrl("../../images/" + name ) - } -} diff --git a/sample-qml/imports/utils/qmldir b/sample-qml/imports/utils/qmldir deleted file mode 100644 index c2df9de..0000000 --- a/sample-qml/imports/utils/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -#/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. -# * -# * This Source Code Form is subject to the terms of the Mozilla Public -# * License, v. 2.0. If a copy of the MPL was not distributed with this -# * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -singleton Style 1.0 Style.qml -Marker 1.0 Marker.qml diff --git a/sample-qml/imports/vehicle/ClimateModel.qml b/sample-qml/imports/vehicle/ClimateModel.qml deleted file mode 100644 index 9633f16..0000000 --- a/sample-qml/imports/vehicle/ClimateModel.qml +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton - -import QtQuick 2.0 -import Automotive.ClimateControl 1.0 - -Item { - property real fanStepSize:1/255 //Represents the stepSize for a given Climate control. - property alias fanSpeed: fanControl.fanSpeedLevel - - property real temperatureStepSize:1/15 //0== 15c, 15 == 30c - - property alias leftTemp: leftFront.targetTemperature - property alias rightTemp: rightFront.targetTemperature - - ClimateControlItem { - id:fanControl - } - - ClimateControlItem { - id: leftFront - zone: 9 - } - - ClimateControlItem { - id: rightFront - zone: 5 - } - - function getRangeValue(inputVal,stepSize){ - if(inputVal > 0){ - return Math.ceil(inputVal/stepSize); - }else{ - return 0; - } - } - -} - diff --git a/sample-qml/imports/vehicle/FuelModel.qml b/sample-qml/imports/vehicle/FuelModel.qml deleted file mode 100644 index fa064e2..0000000 --- a/sample-qml/imports/vehicle/FuelModel.qml +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton - -import QtQuick 2.0 - -Item { - property bool metric: false - - function galToL(value) { - return (metric ? 3.78541 : 1) * value - } - - function mpgToLp100(value) { - return metric ? 235.214583571 / value : value - } - - property real baseTank: 25 - property real tankSize: galToL(baseTank) - property real level: tankSize * percentage * 0.01 - property real percentage: 100 - property real range: metric ? 100 * level / average : level * average - property real baseAverage: 20.7 - property real average: mpgToLp100(baseAverage + mpgDiff) - property real mpgDiff: 0 - - NumberAnimation on percentage { - from: 100 - to: 0 - duration: 5000 - loops: Animation.Infinite - easing.type: Easing.CosineCurve - } - - NumberAnimation on mpgDiff { - from: -2 - to: 2 - duration: 11200 - loops: Animation.Infinite - easing.type: Easing.CosineCurve - } -} diff --git a/sample-qml/imports/vehicle/PositionModel.qml b/sample-qml/imports/vehicle/PositionModel.qml deleted file mode 100644 index 00956aa..0000000 --- a/sample-qml/imports/vehicle/PositionModel.qml +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover, IoT.bzh. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton - -import QtQuick 2.0 -import amb 0.1 - -Item { - property string nmeaString: nmea.value - property real satellites: satsUsed.value - - AutomotivePropertyItem { - id: nmea - - objectName: "GpsNmea" - propertyName: "Nmea" - - Component.onCompleted: nmea.connect(); - } - - AutomotivePropertyItem { - id: satsUsed - - objectName: "GpsSatsUsed" - propertyName: "SatsUsed" - - Component.onCompleted: satsUsed.connect(); - } -} diff --git a/sample-qml/imports/vehicle/SpeedModel.qml b/sample-qml/imports/vehicle/SpeedModel.qml deleted file mode 100644 index 03422b0..0000000 --- a/sample-qml/imports/vehicle/SpeedModel.qml +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton - -import QtQuick 2.0 -import amb 0.1 - -Item { - property bool metric: false - - function mphToKph(value) { - return (metric ? 1.60934 : 1 ) * value - } - - property real max:Math.ceil(mphToKph(baseMaxSpeed)/30)*30 - property real baseMaxSpeed: 255 - property real textSpeed: prop.value - property real percentage: textSpeed / max * 100 - - AutomotivePropertyItem { - id: prop - - objectName: "VehicleSpeed" - propertyName: "Speed" - - Component.onCompleted: prop.connect(); - } - - Behavior on percentage { - SmoothedAnimation { - velocity: 100 - } - } -} diff --git a/sample-qml/imports/vehicle/TemperatureModel.qml b/sample-qml/imports/vehicle/TemperatureModel.qml deleted file mode 100644 index 2bfbbf4..0000000 --- a/sample-qml/imports/vehicle/TemperatureModel.qml +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -pragma Singleton - -import QtQuick 2.0 - -Item { - property bool metric: true - - function unit(value) { - return celsiusToFahrenheit(value).toFixed(1) + "\u00b0" + (metric ? "C" : "F") - } - - function celsiusToFahrenheit(value) { - return (metric ? value : 1.8 * value + 32) - } - - property real indoor: 20.4 - property string indoorString: unit(indoor) - property real outdoor: 28.9 - property string outdoorString: unit(outdoor) -} diff --git a/sample-qml/imports/vehicle/qmldir b/sample-qml/imports/vehicle/qmldir deleted file mode 100644 index 6538e95..0000000 --- a/sample-qml/imports/vehicle/qmldir +++ /dev/null @@ -1,11 +0,0 @@ -#/* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved. -# * -# * This Source Code Form is subject to the terms of the Mozilla Public -# * License, v. 2.0. If a copy of the MPL was not distributed with this -# * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -singleton FuelModel 1.0 FuelModel.qml -singleton SpeedModel 1.0 SpeedModel.qml -singleton TemperatureModel 1.0 TemperatureModel.qml -singleton PositionModel 1.0 PositionModel.qml -singleton ClimateModel 1.0 ClimateModel.qml |