diff options
Diffstat (limited to 'sample-qml/imports/components')
-rw-r--r-- | sample-qml/imports/components/AwesomeIcon.qml | 26 | ||||
-rw-r--r-- | sample-qml/imports/components/Box.qml | 49 | ||||
-rw-r--r-- | sample-qml/imports/components/BoxButton.qml | 36 | ||||
-rw-r--r-- | sample-qml/imports/components/BoxHeading.qml | 37 | ||||
-rw-r--r-- | sample-qml/imports/components/Button.qml | 30 | ||||
-rw-r--r-- | sample-qml/imports/components/DateTime.qml | 35 | ||||
-rw-r--r-- | sample-qml/imports/components/HexGrid.qml | 32 | ||||
-rw-r--r-- | sample-qml/imports/components/HexSwitch.qml | 80 | ||||
-rw-r--r-- | sample-qml/imports/components/InShadow.qml | 33 | ||||
-rw-r--r-- | sample-qml/imports/components/InsetShadow.qml | 40 | ||||
-rw-r--r-- | sample-qml/imports/components/Label.qml | 27 | ||||
-rw-r--r-- | sample-qml/imports/components/NumberPad.qml | 101 | ||||
-rw-r--r-- | sample-qml/imports/components/OutShadow.qml | 41 | ||||
-rw-r--r-- | sample-qml/imports/components/Switch.qml | 13 | ||||
-rw-r--r-- | sample-qml/imports/components/qmldir | 16 |
15 files changed, 0 insertions, 596 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 |