diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2015-10-19 13:48:23 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2015-11-16 14:04:52 +0000 |
commit | 0446271eb6ce5f2f24662031ce55fcf6ee500ba4 (patch) | |
tree | a991373c1336ecd5452c7e146758e86e676dacde /sysui | |
parent | 0eb472c7031ba2cfe1cc49153865e36f3162abfe (diff) |
Initial commit of Pelagicore's Neptune-UI with squashed history.
Change-Id: I36747394458e3528f38ed9c078334c260f22d53b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'sysui')
51 files changed, 4496 insertions, 0 deletions
diff --git a/sysui/About.qml b/sysui/About.qml new file mode 100644 index 0000000..c53d1e9 --- /dev/null +++ b/sysui/About.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + signal clicked() + + Image { + x: Style.hspan(4) + y: Style.vspan(2) + source: Style.gfx2Dynamic("pelagicore_colored_white", Style.defaultGfxSize) + + width: Style.hspan(7) + height: Style.vspan(4) + + fillMode: Image.PreserveAspectFit + } + + Image { + source: Style.gfx2("headunit") + width: Style.hspan(8) + + y: Style.vspan(9) + x: Style.hspan(4) + + fillMode: Image.PreserveAspectFit + } + + Label { + + x: Style.hspan(8) + y: Style.vspan(8) + + width: Style.hspan(12) + height: Style.vspan(10) + + text: "Bring stunning UX to the road. \n\nPELUX® HeadUnit enables you to design and implement a center-stack user experience (UX) that brings your customers closer to your brand. You will deliver a rock-solid head unit with a UX that’s in-line with next generation mobile devices." + wrapMode: Text.Wrap + font.pixelSize: Style.fontSizeL + } + + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } +} diff --git a/sysui/Climate/AirFlow.qml b/sysui/Climate/AirFlow.qml new file mode 100644 index 0000000..13c3c77 --- /dev/null +++ b/sysui/Climate/AirFlow.qml @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtGraphicalEffects 1.0 +import utils 1.0 + +UIElement { + id: root + + hspan: 6 + vspan: 3 + + PathView { + id: view + + width: Style.hspan(6) + height: Style.vspan(3) + anchors.centerIn: parent + + clip: true + + currentIndex: 1 + + model: ListModel { + ListElement { up: 1; down: 0 } + ListElement { up: 0; down: 1 } + ListElement { up: 1; down: 1 } + } + + snapMode: PathView.SnapOneItem + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + + delegate: UIElement { + hspan: 2 + vspan: 3 + + Image { + anchors.top: seatPerson.top + anchors.horizontalCenter: seatPerson.horizontalCenter + anchors.horizontalCenterOffset: -Style.padding + source: Style.symbolXS("arrow") + rotation: 90 + visible: model.up + } + + Image { + id: seatPerson + anchors.centerIn: parent + anchors.horizontalCenterOffset: Style.padding + source: Style.symbolM("seat_person") + } + + Image { + anchors.right: seatPerson.left + anchors.rightMargin: -Style.padding + anchors.verticalCenter: seatPerson.verticalCenter + anchors.verticalCenterOffset: 12 + source: Style.symbolXS("arrow") + rotation: 90 + visible: model.down + } + + MouseArea { + anchors.fill: parent + onClicked: view.currentIndex = index + } + } + + path: Path { + startX: 0 + startY: view.height/2 + + PathLine { + x: view.width + y: view.height/2 + } + } + + layer.effect: OpacityMask { + anchors.fill: view + + maskSource: LinearGradient { + width: root.width + height: root.height + start: Qt.point(0,0) + end: Qt.point(root.width, 0) + gradient: Gradient { + GradientStop { position: 0.05; color: "#00000000" } + GradientStop { position: 0.5; color: "#ff000000" } + GradientStop { position: 0.95; color: "#00000000" } + } + } + } + + layer.enabled: true + } +} diff --git a/sysui/Climate/ClimateBar.qml b/sysui/Climate/ClimateBar.qml new file mode 100644 index 0000000..be0a9a9 --- /dev/null +++ b/sysui/Climate/ClimateBar.qml @@ -0,0 +1,216 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import controls 1.0 +import utils 1.0 +import service.climate 1.0 + +UIElement { + id: root + + property bool expanded: false + property int collapsedVspan: 3 + + hspan: 24 + vspan: 24 + + MouseArea { + anchors.fill: parent + onClicked: climateBar.expanded = !climateBar.expanded + } + + DisplayBackground { + anchors.fill: parent + visible: climatePanelBackground.opacity !== 1 + } + + ClimatePanelBackground { + id: climatePanelBackground + + vspan: collapsedVspan + anchors.left: parent.left + anchors.right: parent.right + opacity: !expanded + visible: opacity !== 0 + Behavior on opacity { NumberAnimation { duration: 450 } } + } + + ColumnLayout { + id: mainLayout + + spacing: 0 + anchors.horizontalCenter: parent.horizontalCenter + width: Style.hspan(23) + + Item { + height: Style.vspan(root.collapsedVspan) + Layout.preferredWidth: mainLayout.width + + TemperatureLevel { + id: tempLevelLeft + value: ClimateService.leftSeat.value + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + } + + Tool { + id: leftSeatHeat + hspan: 1 + vspan: root.collapsedVspan + name: "seat_left" + active: ClimateService.leftSeat.heat + onClicked: ClimateService.leftSeat.heat = !active + anchors.left: tempLevelLeft.right + anchors.verticalCenter: parent.verticalCenter + } + + AirFlow { + hspan: 6 + vspan: root.collapsedVspan + anchors.left: leftSeatHeat.right + anchors.right: rightSeatHeat.left + anchors.verticalCenter: parent.verticalCenter + } + + Tool { + id: rightSeatHeat + hspan: 1 + vspan: root.collapsedVspan + name: "seat_right" + active: ClimateService.rightSeat.heat + onClicked: ClimateService.rightSeat.heat = !active + anchors.right: tempLevelRight.left + anchors.verticalCenter: parent.verticalCenter + } + + TemperatureLevel { + id: tempLevelRight + horizontalAlignment: Qt.AlignRight + value: ClimateService.rightSeat.value + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + } + + RowLayout { + spacing: 0 + Layout.preferredHeight: Style.vspan(19) + visible: climatePanelBackground.opacity !== 1 + + TemperatureSlider { + id: leftTempSlider + hspan: 3 + Layout.fillHeight: true + minValue: ClimateService.leftSeat.minValue + maxValue: ClimateService.leftSeat.maxValue + value: ClimateService.leftSeat.value + onValueChanged: ClimateService.leftSeat.value = value + } + + Spacer { + Layout.fillWidth: true + Layout.fillHeight: true + } + + ColumnLayout { + spacing: 0 + Layout.alignment: Qt.AlignTop + Layout.fillWidth: true + + Spacer { + Layout.fillWidth: true + vspan: 2 + } + + Ventilation { + id: ventilation + + Layout.alignment: Qt.AlignHCenter + hspan: 10 + vspan: 2 + levels: ClimateService.ventilationLevels + currentLevel: ClimateService.ventilation + onCurrentLevelChanged: ClimateService.ventilation = currentLevel + } + + Spacer { + Layout.fillWidth: true + vspan: 2 + } + + ClimateOptionsGrid { + Layout.alignment: Qt.AlignHCenter + hspan: 9 + vspan: 10 + + model: ClimateService.climateOptions + delegate: ClimateGridButton { + hspan: 3 + vspan: 5 + symbolName: modelData.symbol + active: modelData.enabled + onClicked: modelData.enabled = !modelData.enabled + } + } + } + + Spacer { + Layout.fillWidth: true + Layout.fillHeight: true + } + + TemperatureSlider { + id: rightTempSlider + Layout.fillHeight: true + hspan: 3 + mirrorSlider: true + minValue: ClimateService.rightSeat.minValue + maxValue: ClimateService.rightSeat.maxValue + value: ClimateService.rightSeat.value + onValueChanged: ClimateService.rightSeat.value = value + } + + } + + Spacer { + Layout.fillHeight: true + Layout.fillWidth: true + } + } + + Connections { + target: ClimateService.leftSeat + onValueChanged: leftTempSlider.value = ClimateService.leftSeat.value + } + + Connections { + target: ClimateService.rightSeat + onValueChanged: rightTempSlider.value = ClimateService.rightSeat.value + } +} diff --git a/sysui/Climate/ClimateGridButton.qml b/sysui/Climate/ClimateGridButton.qml new file mode 100644 index 0000000..2382e37 --- /dev/null +++ b/sysui/Climate/ClimateGridButton.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 +import controls 1.0 + +UIElement { + id: root + + property alias symbolName: symbol.name + property alias active: symbol.active + + signal clicked + + BorderImage { + anchors.fill: parent + anchors.margins: 1 + source: Style.gfx("appstore_grid_cell_panel") + border { + left: 4 + right: 4 + top: 4 + bottom: 4 + } + } + + Symbol { + id: symbol + size: Style.symbolSizeM + anchors.fill: parent + } + + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } +} diff --git a/sysui/Climate/ClimateOptionsGrid.qml b/sysui/Climate/ClimateOptionsGrid.qml new file mode 100644 index 0000000..dae803f --- /dev/null +++ b/sysui/Climate/ClimateOptionsGrid.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +UIElement { + id: root + + property alias model: repeater.model + property alias delegate: repeater.delegate + + Grid { + anchors.fill: parent + + columns: 3 + + Repeater { + id: repeater + } + } +} diff --git a/sysui/Climate/ClimatePanelBackground.qml b/sysui/Climate/ClimatePanelBackground.qml new file mode 100644 index 0000000..c32aaaa --- /dev/null +++ b/sysui/Climate/ClimatePanelBackground.qml @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +UIElement { + + Rectangle { + anchors.fill: parent + color: Style.colorBlack + } +} diff --git a/sysui/Climate/TemperatureLevel.qml b/sysui/Climate/TemperatureLevel.qml new file mode 100644 index 0000000..8fedc57 --- /dev/null +++ b/sysui/Climate/TemperatureLevel.qml @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + property real value: 0 + property int horizontalAlignment: Qt.AlignLeft + + hspan: 2 + vspan: 3 + + Item { + id: content + + property var values: value.toFixed(1).toString().split(".") + property bool showDecimal: values[1] !== '0' + + anchors.left: horizontalAlignment === Qt.AlignLeft ? parent.left : undefined + anchors.right: horizontalAlignment === Qt.AlignRight ? parent.right : undefined + anchors.horizontalCenter: horizontalAlignment === Qt.AlignHCenter ? parent.horizontalCenter : undefined + + width: childrenRect.width + height: parent.height + + Text { + id: integerPart + + anchors.verticalCenter: parent.verticalCenter + verticalAlignment: Text.AlignVCenter + height: Style.vspan(1) + + text: content.values[0] + + color: Style.colorWhite + font.pixelSize: Style.fontSizeXXL + font.family: Style.fontFamily + font.weight: Style.fontWeight + } + + Text { + id: decimalPart + + anchors.left: integerPart.right + anchors.baseline: integerPart.baseline + height: Style.vspan(1) + + text: "." + content.values[1] + + visible: content.showDecimal + color: Style.colorWhite + font.pixelSize: Style.fontSizeM + font.family: Style.fontFamily + font.weight: Style.fontWeight + } + + Text { + id: unit + anchors.left: integerPart.right + anchors.leftMargin: Style.padding + anchors.baseline: integerPart.baseline + height: Style.vspan(1) + + text: qsTr("°c") + + color: Style.colorWhite + font.pixelSize: Style.fontSizeXXL*0.97 //RG: the 0.97 is there to get around a font rendering bug on the iMX6 + font.family: Style.fontFamily + font.weight: Style.fontWeight + } + } +} diff --git a/sysui/Climate/TemperatureSlider.qml b/sysui/Climate/TemperatureSlider.qml new file mode 100644 index 0000000..8305aa1 --- /dev/null +++ b/sysui/Climate/TemperatureSlider.qml @@ -0,0 +1,185 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtGraphicalEffects 1.0 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + readonly property int roundingModeWhole: 1 + readonly property int roundingModeHalf: 2 + + property bool mirrorSlider: false + + property real minValue: 16 + property real maxValue: 28 + property real value: minValue + property int roundingMode: roundingModeHalf + + transform: Rotation { + angle: mirrorSlider ? 180 : 0 + axis { x: 0; y: 1; z: 0 } + origin { x: root.width/2; y: root.height/2 } + } + + ColumnLayout { + id: barRow + + spacing: 0 + width: parent.width + height: parent.height + + Text { + Layout.preferredWidth: Style.hspan(2) + Layout.preferredHeight: Style.vspan(2) + + font.family: Style.fontFamily + font.pixelSize: Style.fontSizeXL + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: "+" + color: Style.colorWhite + + MouseArea { + anchors.fill: parent + onClicked: root.value = root._clamp(root.value + 1 / root.roundingMode) + } + } + + ListView { + id: view + + Layout.fillHeight: true + Layout.preferredWidth: Style.hspan(3) + + property int itemHeight: 7 + + property real deltaRed: (0xa6 - 0xf0) / view.count + property real deltaGreen: (0xd5 - 0x7d) / view.count + property real deltaBlue: (0xda - 0x0) / view.count + + function calcRed(index) { return (deltaRed * (view.count-index) + 0xf0) / 255 } + function calcGreen(index) { return (deltaGreen * (view.count-index) + 0x7d) / 255 } + function calcBlue(index) { return (deltaBlue * (view.count-index) + 0x0) / 255 } + + Behavior on currentIndex { SmoothedAnimation { velocity: view.count*2} } + + currentIndex: (root.value - root.minValue) / (root.maxValue - root.minValue) * view.count + + onCurrentItemChanged: if (currentItem) handle.currentItemY = currentItem.y + + // NOTE: verticalLayoutDirection: ListView.BottomToTop doesn't seem to play well with the mouse area + rotation: 180 + orientation: Qt.Vertical + interactive: false + model: height/itemHeight + + delegate: Item { + width: view.width + height: view.itemHeight + property int entry: index + + Rectangle { + id: stripe + + property bool bottomPart: view.currentIndex >= index + + antialiasing: true + anchors.right: parent.right + width: parent.width - Style.hspan(1) + height: parent.height - 3 + border.color: Qt.darker(color, 1.5) + border.width: 1 + color: Qt.rgba(view.calcRed(index), view.calcGreen(index), view.calcBlue(index)) + //radius: 1 + scale: bottomPart ? 1.0 : 0.96 + transformOrigin: Item.Left + Behavior on scale { NumberAnimation { easing.type: Easing.OutQuad } } + opacity: bottomPart ? 1.0 : 0.6 + Behavior on opacity { NumberAnimation {} } + } + } + + Symbol { + id: handle + + property real currentItemY: view.currentItem ? view.currentItem.y : 0 + anchors.left: parent.left + width: Style.hspan(1) + height: Style.vspan(1) + y: currentItemY - height / 2 + 3 + + opacity: 0.4 + name: "slider_marker" + rotate: root.mirrorSlider ? -180 : 180 + } + + MouseArea { + id: dragArea + anchors.fill: view + hoverEnabled: false + preventStealing: true + onClicked: updateCurrentIndex(mouse.x, mouse.y) + onPositionChanged: updateCurrentIndex(mouse.x, mouse.y) + + function updateCurrentIndex(x, y) { + var item = view.itemAt(x, y); + if (item) { + root.value = root._clamp(item.entry / view.count * (root.maxValue - root.minValue) + root.minValue) + } + } + } + } + + Text { + Layout.preferredWidth: Style.hspan(2) + Layout.preferredHeight: Style.vspan(2) + + font.family: Style.fontFamily + font.pixelSize: Style.fontSizeXL + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: "-" + color: Style.colorWhite + + MouseArea { + anchors.fill: parent + onClicked: root.value = root._clamp(root.value - 1 / root.roundingMode) + } + } + } + + function _clamp(value) { + return Math.round(Math.min(root.maxValue, Math.max(root.minValue, value))*root.roundingMode)/root.roundingMode + } +} diff --git a/sysui/Climate/Ventilation.qml b/sysui/Climate/Ventilation.qml new file mode 100644 index 0000000..dc16796 --- /dev/null +++ b/sysui/Climate/Ventilation.qml @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + // Number of levels including zero which means 'off'. 7 equals 6 levels + off + property int levels + property alias currentLevel: view.currentIndex + + MouseArea { + anchors.fill: view + anchors.leftMargin: Style.hspan(2) + anchors.rightMargin: Style.hspan(2) + onClicked: updateIndex(mouse.x, mouse.y) + onPositionChanged: updateIndex(mouse.x, mouse.y) + + function updateIndex(x, y) { + var index = view.indexAt(x, y) + if (index > 0) { + view.currentIndex = Math.min(index, view.count-1) + } + } + } + + ListView { + id: view + + anchors.centerIn: parent + + width: Style.hspan(levels-1 + 2 + 2) + height: Style.vspan(2) + orientation: ListView.Horizontal + + interactive: false + model: levels + + Behavior on currentIndex { SmoothedAnimation { velocity: view.count*2} } + + header: Symbol { + hspan: 2 + vspan: 2 + name: "fan" + size: Style.symbolSizeS + MouseArea { + anchors.fill: parent + onClicked: view.decrementCurrentIndex() + } + } + + footer: Symbol { + hspan: 2 + vspan: 2 + name: "fan" + size: Style.symbolSizeM + MouseArea { + anchors.fill: parent + onClicked: view.incrementCurrentIndex() + } + } + + delegate: Rectangle { + width: index === 0 ? 0 : Style.hspan(1) + height: Style.vspan(2) + border.color: Qt.darker(color, 1.5) + color: '#fff' + radius: 1 + opacity: view.currentIndex >= index ? 1.0 : 0.5 + Behavior on opacity { NumberAnimation {} } + } + } +} diff --git a/sysui/Cloud/CloudPage.qml b/sysui/Cloud/CloudPage.qml new file mode 100644 index 0000000..bf7a3a5 --- /dev/null +++ b/sysui/Cloud/CloudPage.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +UIPage { + id: root + hspan: 24 + vspan: 24 + + title: "MY CLOUD" + symbolName: "my_cloud" + + TabView { + id: tabView + anchors.fill: parent + tabs: [ + { title : "SETTINGS", url : Qt.resolvedUrl("Settings/SettingsScreen.qml"), properties : {} }, + { title : "APP STORE", url : Qt.resolvedUrl("Store/StoreScreen.qml"), properties : {} }, + ] + } +} diff --git a/sysui/Cloud/Settings/SettingsScreen.qml b/sysui/Cloud/Settings/SettingsScreen.qml new file mode 100644 index 0000000..4beabbf --- /dev/null +++ b/sysui/Cloud/Settings/SettingsScreen.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +import controls 1.0 +import utils 1.0 +import service.settings 1.0 + +UIElement { + id: root + + ListViewManager { + id: settingsListView + + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top; anchors.bottom: parent.bottom + hspan: 14 + + model: SettingsService.entries + + delegate: SettingsListItem { + hspan: settingsListView.hspan + vspan: 2 + + iconName: model.icon + titleText: model.title + checked: model.checked + hasChildren: model.hasChildren + } + } + + Image { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + source: Style.icon('cloud_bottom_shadow') + asynchronous: true + visible: false + } +} diff --git a/sysui/Cloud/Store/AppGridItemDelegate.qml b/sysui/Cloud/Store/AppGridItemDelegate.qml new file mode 100644 index 0000000..971f349 --- /dev/null +++ b/sysui/Cloud/Store/AppGridItemDelegate.qml @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + property string icon + property alias titleText: titleLabel.text + property alias subtitleText: subtitleLabel.text + + signal clicked() + + Image { + anchors.fill: parent + anchors.rightMargin: 1 + source: Style.icon('appstore_grid_cell_panel') + asynchronous: true + } + + Column { + anchors.left: parent.left; anchors.right: parent.right + anchors.bottom: parent.bottom; anchors.bottomMargin: Style.padding + + spacing: Style.paddingXL + + Image { + id: iconImage + + anchors.horizontalCenter: parent.horizontalCenter + + width: Style.hspan(2) + + source: root.icon //Style.icon(root.icon) + + fillMode: Image.PreserveAspectFit + asynchronous: true + } + + Column { + anchors.left: parent.left; anchors.right: parent.right + spacing: -10 + + Label { + id: titleLabel + + anchors.left: parent.left; anchors.right: parent.right + anchors.margins: Style.padding + font.capitalization: Font.AllUppercase + + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Style.fontSizeS + color: Style.colorWhite + elide: Text.ElideRight + } + + Label { + id: subtitleLabel + + anchors.left: parent.left; anchors.right: parent.right + anchors.margins: Style.padding + font.capitalization: Font.AllUppercase + + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Style.fontSizeXXS + color: Style.colorGrey + } + } + } + + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } +} diff --git a/sysui/Cloud/Store/AppGridView.qml b/sysui/Cloud/Store/AppGridView.qml new file mode 100644 index 0000000..16357ee --- /dev/null +++ b/sysui/Cloud/Store/AppGridView.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + property string appCategory: "" + property alias cellWidth: grid.cellWidth + property alias cellHeight: grid.cellHeight + property alias model: grid.model + property alias delegate: grid.delegate + property bool loading: true + + onLoadingChanged: print("loading: ", loading, model.count) + + GridView { + id: grid + + anchors.fill: parent + + clip: true + + NotFoundOverlay { + anchors.top: parent.top; anchors.topMargin: Style.vspan(6) + width: parent.width + + text: loading ? "Loading..." : model.count === 0 ? qsTr("No apps found in %1").arg(root.appCategory) : "" + overlayVisible: loading || model.count === 0 + } + } +} diff --git a/sysui/Cloud/Store/AppStore.qml b/sysui/Cloud/Store/AppStore.qml new file mode 100644 index 0000000..af5fadf --- /dev/null +++ b/sysui/Cloud/Store/AppStore.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import "JSONBackend.js" as JSONBackend +import com.pelagicore.ApplicationManager 0.1 + +Item { + + property bool serverOnline: false + property string serverReason + property string server: ApplicationManager.additionalConfiguration.appStoreServerUrl + + signal loginSuccessful() + + function goBack() { + if (categoriesPage.state != "") + categoriesPage.goBack() + else + root.close(); + } + + function checkServer() { + print("#####################checkserver#####################") + var url = server + "/hello" + var data = {"platform" : "AM", "version" : "1"} + JSONBackend.setErrorFunction(function () { + serverOnline = false + serverReason = "unknown" + }) + JSONBackend.serverCall(url, data, function(data) { + if (data !== 0) { + if (data.status == "ok") { + serverOnline = true + login() + //refresh() + } else if (data.status == "maintenance") { + serverOnline = false + serverReason = "maintenance" + } else { + print("HELLO ERROR: " + data.error) + serverOnline = false + } + } else { + serverOnline = false + serverReason = "unknown" + } + }) + } + + function login() { + var url = server + "/login" + var data = {"username" : "t", "password" : "t", "imei" : "112163001487801"} + JSONBackend.serverCall(url, data, function(data) { + if (data !== 0) { + if (data.status == "ok") { + print("LOGIN SUCCESSFUL"); + loginSuccessful() + } else { + print("LOGIN ERROR: " + data.error) + } + } + }) + } + Component.onCompleted: checkServer() +} diff --git a/sysui/Cloud/Store/AppStoreController.qml b/sysui/Cloud/Store/AppStoreController.qml new file mode 100644 index 0000000..d519ebf --- /dev/null +++ b/sysui/Cloud/Store/AppStoreController.qml @@ -0,0 +1,153 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.apps 1.0 + +import "JSONBackend.js" as JSONBackend +import com.pelagicore.ApplicationInstaller 0.1 + +Item { + id: root + + property int categoryid: 1 + property string filter: "" + + function download(id) { + var url = appstore.server + "/app/purchase" + var data = {"id": id, "device_id" : "00-11-22-33-44-55" } + + JSONBackend.serverCall(url, data, function(data) { + if (data !== 0) { + if (data.status === "ok") { + print("start downloading") + var icon = appstore.server + "/app/icon?id=" + id + var installID = ApplicationInstaller.startPackageInstallation("internal-0", data.url); + ApplicationInstaller.acknowledgePackageInstallation(installID); + } else if (data.status === "fail" && data.error === "not-logged-in"){ + print(":::AppStoreController::: not logged in") + } else { + print(":::AppStoreController::: download failed: " + data.error) + } + } + }) + } + + AppStore { + id: appstore + onLoginSuccessful: categoriesModel.refresh() + } + + JSONModel { + id: categoriesModel + url: appstore.server + "/category/list" + } + + JSONModel { + id: appModel + url: appstore.server + "/app/list" + data: root.categoryid >= 0 ? { "filter" : root.filter , "category_id" : root.categoryid} : { "filter" : root.filter} + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + + Column { + width: Style.hspan(4) + + ListViewManager { + id: categoryView + + anchors.left: parent.left; anchors.right: parent.right + vspan: 14 + + model: categoriesModel + + header: Label { + // The graphics for the category list is not align to the grid, have to specify hardcoded values. + height: Style.vspan(5/3) + anchors.left: parent.left; anchors.right: parent.right + anchors.margins: Style.paddingXL + + text: "CATEGORY" + font.pixelSize: Style.fontSizeM + } + + delegate: CategoryListItem { + width: ListView.view.width + height: Style.vspan(5/3) + text: model.name //.title + onClicked: ListView.view.currentIndex = index + } + + onCurrentIndexChanged: { + appGrid.appCategory = model.get(currentIndex) ? model.get(currentIndex).name : "" + categoryid = model.get(currentIndex) ? model.get(currentIndex).id : 1 + appModel.refresh() + } + } + } + + AppGridView { + id: appGrid + // The graphics for the category list is not align to the grid, have to specify hardcoded values. + width: Style.hspan(3)*4 + height: root.height + loading: categoriesModel.status !== "ready" || appModel.status !== "ready" + + cellWidth: Style.hspan(3) + cellHeight:Style.vspan(5) + + appCategory: "" + + model: appModel + + delegate: AppGridItemDelegate { + width: GridView.view.cellWidth + height: GridView.view.cellHeight + + icon: appstore.server + "/app/icon?id=" + model.id //model.icon + titleText: model.name //model.title + subtitleText: model.category //model.subtitle + + onClicked: download(model.id) + } + } + } + + Image { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + source: Style.icon('appstore_bottom_shadow') + asynchronous: true + visible: false + } + } diff --git a/sysui/Cloud/Store/JSONBackend.js b/sysui/Cloud/Store/JSONBackend.js new file mode 100644 index 0000000..a1ba1b1 --- /dev/null +++ b/sysui/Cloud/Store/JSONBackend.js @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +.pragma library + +var request = new XMLHttpRequest() +var errorCounter = 0 +var errorFunc = 0 + +//Will be called when the error is not responding after a few tries +function setErrorFunction(func) { + errorFunc = func +} + +function serverCall(url, data, dataReadyFunction, xhr) { + var i = 0 + for (var key in data) + { + if (i === 0) { + url += "?" + key + "=" + data[key]; + } else { + url += "&" + key+ "=" + data[key]; + } + i++ + } + + //when no xhr is defined use the global one and reuse it + if (xhr == undefined) { + xhr = new XMLHttpRequest() + } + + console.log("HTTP GET to " + url); + if (xhr.readyState != 0) { + xhr.abort(); + } + xhr.open("GET", url); + xhr.onreadystatechange = function() { + if (xhr.readyState == XMLHttpRequest.DONE) { + //print(xhr.responseText); + + if (xhr.responseText !== "") { + errorCounter = 0 + var data = JSON.parse(xhr.responseText); + return dataReadyFunction(data) + } else { + print("JSONBackend: " + xhr.status + xhr.statusText) + errorCounter++ + if (errorCounter >= 3 && errorFunc) { + errorFunc() + } + + return dataReadyFunction(0) + } + } + } + xhr.send(); +} + +function abortableServerCall(url, data, dataReadyFunction) { + serverCall(url,data,dataReadyFunction,request) +} diff --git a/sysui/Cloud/Store/JSONModel.qml b/sysui/Cloud/Store/JSONModel.qml new file mode 100644 index 0000000..beae582 --- /dev/null +++ b/sysui/Cloud/Store/JSONModel.qml @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import "JSONBackend.js" as JSONBackend + +ListModel { + id: contenModel + + property int itemCount: 10; + property string url: "" + property variant data + property string status: "empty" + + function refresh() { + status = "loading" + clear(); + JSONBackend.abortableServerCall(url, data, function(data) { + for (var i = 0; i < data.length; i++) { + var entry = data[i]; + append(entry); + } + status = "ready" + }) + } +} diff --git a/sysui/Cloud/Store/LoadingPage.qml b/sysui/Cloud/Store/LoadingPage.qml new file mode 100644 index 0000000..2818980 --- /dev/null +++ b/sysui/Cloud/Store/LoadingPage.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Image { + anchors.fill: parent + + z:2 + + Text { + anchors.centerIn: parent + + text: "Loading..." + color: "white" + font.pixelSize: 24 + } +} diff --git a/sysui/Cloud/Store/NotFoundOverlay.qml b/sysui/Cloud/Store/NotFoundOverlay.qml new file mode 100644 index 0000000..4d04b6d --- /dev/null +++ b/sysui/Cloud/Store/NotFoundOverlay.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import utils 1.0 +import controls 1.0 + +Label { + id: root + + property bool overlayVisible: false + + horizontalAlignment: Qt.AlignHCenter + opacity: overlayVisible + + Behavior on opacity { NumberAnimation { duration: 200 } } +} diff --git a/sysui/Cloud/Store/StoreScreen.qml b/sysui/Cloud/Store/StoreScreen.qml new file mode 100644 index 0000000..cde148e --- /dev/null +++ b/sysui/Cloud/Store/StoreScreen.qml @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 + +Item { + id: root + + AppStoreController { + anchors.fill: parent; anchors.topMargin: Style.vspan(1) + } +} diff --git a/sysui/Cluster/Cluster.qml b/sysui/Cluster/Cluster.qml new file mode 100644 index 0000000..a2353ea --- /dev/null +++ b/sysui/Cluster/Cluster.qml @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +Item { + id: root + + width: 1920 + height: 720 + + property bool zoom: false + + Image { + anchors.fill: parent + source: Style.gfx("cluster/background") + } + + Middle { + id: widgetBase + anchors.centerIn: parent + onZoomIn: { + widgetBase.width = 1000 + root.zoom = true + } + + onZoomOut: { + widgetBase.width = 700 + root.zoom = false + } + } + + LeftDial { + id: leftDial + x: root.zoom ? -230 : 0 + zoom: root.zoom + } + + RightDial { + id: rightDial + x: root.zoom ? 1240 : (1920 - width) + zoom: root.zoom + } + + Top { + id: topbar + y: root.zoom ? - topbar.height : 11 + anchors.horizontalCenter: parent.horizontalCenter + } + + Notifications { + id: notifications + y: root.zoom ? root.height : root.height - notifications.height - 15 + anchors.horizontalCenter: parent.horizontalCenter + } + + Image { + anchors.fill: parent + source: Style.gfx("cluster/mask_overlay") + } + + focus: Style.debugMode + + Keys.onPressed: { + if (event.key == Qt.Key_Space) { + if (overlay.opacity < 0.5) overlay.opacity = 0.5 + else overlay.opacity = 0 + } + } + + Keys.forwardTo: Style.debugMode ? [layouter] : null + + property var layoutTarget: notifications + + Layouter { + id: layouter + target: layoutTarget + } +} diff --git a/sysui/Cluster/Dial.qml b/sysui/Cluster/Dial.qml new file mode 100644 index 0000000..a484762 --- /dev/null +++ b/sysui/Cluster/Dial.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +Item { + id: root + property real value: 0 + property int upDuration: 2000 + property int downDuration: 1000 + + width: meter.width + height: meter.height + + Image { + id: meter + property real min: -83.5 + property real max: 157 + + rotation: min + (max - min) * root.value + + source: Style.gfx("cluster/dial_cursor") + + ShaderEffect { + anchors.fill: parent + property var pattern: Image { + source: Style.gfx("cluster/dial_pattern") + } + property var fill: Image { + source: Style.gfx("cluster/dial_fill_color") + } + property real value: root.value + + fragmentShader: " + #define M_PI 3.141592653589793 + #define INNER 0.213 + + varying highp vec2 qt_TexCoord0; + uniform lowp float qt_Opacity; + uniform sampler2D pattern; + uniform sampler2D fill; + uniform lowp float value; + + void main() { + lowp vec4 pattern = texture2D(pattern, qt_TexCoord0); + lowp vec4 fill = texture2D(fill, qt_TexCoord0); + + lowp vec2 pos = vec2(qt_TexCoord0.x - 0.5, 0.501 - qt_TexCoord0.y); + lowp float d = length(pos); + lowp float angle = atan(pos.x, pos.y) / (2.0 * M_PI); + lowp float v = 0.66 * value - 0.33; + + // Flare pattern + lowp vec4 color = mix(pattern, vec4(0.0), smoothstep(v, v + 0.1, angle)); + // Gradient fill color + color += mix(fill, vec4(0.0), step(v, angle)); + // Punch out the center hole + color = mix(vec4(0.0), color, smoothstep(INNER - 0.001, INNER + 0.001, d)); + // Fade out below 0 + gl_FragColor = mix(color, vec4(0.0), smoothstep(-0.35, -0.5, angle)); + } + " + } + } +} diff --git a/sysui/Cluster/LeftDial.qml b/sysui/Cluster/LeftDial.qml new file mode 100644 index 0000000..2ae685b --- /dev/null +++ b/sysui/Cluster/LeftDial.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 +import service.vehicle 1.0 + +Item { + id: root + + width: childrenRect.width + height: childrenRect.height + + scale: zoom ? 0.7 : 1 + property bool zoom: false + property int angle: zoom ? 45 : 0 + + Behavior on angle { + NumberAnimation { duration: 200 } + } + + Behavior on x { + NumberAnimation { duration: 200 } + } + + Behavior on scale { + NumberAnimation { duration: 200 } + } + + transform: Rotation { origin.x: root.width/2; origin.y: root.height/2; axis { x: 0; y: 1; z: 0 } angle: root.angle } + + Image { + id: background + source: Style.gfx("cluster/left_dial_background") + } + + Dial { + anchors.centerIn: overlay + anchors.verticalCenterOffset: 18 + + value: VehicleService.speed / 240 + } + + Image { + id: overlay + anchors.top: background.top + anchors.left: background.left + anchors.topMargin: 116 + anchors.leftMargin: 174 + + source: Style.gfx("cluster/left_dial_overlay") + } + + Text { + id: speedText + + anchors.verticalCenter: overlay.verticalCenter + anchors.horizontalCenter: overlay.horizontalCenter + anchors.verticalCenterOffset: -6 + + font.family: Style.fontFamily + font.pixelSize: 110 + font.letterSpacing: 4 + color: Style.colorWhite + text: VehicleService.displaySpeed + } +} diff --git a/sysui/Cluster/Middle.qml b/sysui/Cluster/Middle.qml new file mode 100644 index 0000000..6f1c78b --- /dev/null +++ b/sysui/Cluster/Middle.qml @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.2 +import utils 1.0 +import service.statusbar 1.0 +import service.apps 1.0 + +Item { + id: root + width: 700 + height: 710 + + focus: true + + signal zoomIn() + signal zoomOut() + + Behavior on width { + NumberAnimation { duration: 200} + } + + Behavior on height { + NumberAnimation { duration: 200} + } + + ListView { + id: stack + anchors.fill: parent + orientation: ListView.Horizontal + snapMode: ListView.SnapOneItem + highlightMoveDuration: 300 + interactive: false + currentIndex: 0 + clip: true + model: VisualItemModel { + WidgetContainer { + id: navContainer + width: stack.width + height: stack.height + title: "NAVIGATOR" + } + WidgetContainer { + id: musicContainer + width: stack.width + height: stack.height + title: "MUSIC" + } + WidgetContainer { + id: otherContainer + width: stack.width + height: stack.height + title: "OTHER" + } + } + + Component.onCompleted: StatusBarService.clusterTitle = Qt.binding(function() { return currentItem.title}) + } + + Connections { + target: AppsService + onClusterWidgetReady: { + if (category === "media") { + musicContainer.content = item + stack.currentIndex = 1 + } + else if (category === "navigation") { + navContainer.content = item + stack.currentIndex = 0 + } + else { + otherContainer.content = item + stack.currentIndex = 2 + } + } + } + + Keys.onPressed: { + //print("key pressed", Qt.Key_Plus, event.key) + if (event.key === Qt.Key_Right) { + if (stack.currentIndex < stack.count) + stack.currentIndex++ + } + else if (event.key === Qt.Key_Left) { + if (stack.currentIndex > 0) + stack.currentIndex-- + } + else if (event.key === Qt.Key_Plus) { + root.zoomIn() + } + else if (event.key === Qt.Key_Minus) { + root.zoomOut() + } + } + + Keys.forwardTo: stack.currentItem +} diff --git a/sysui/Cluster/Notifications.qml b/sysui/Cluster/Notifications.qml new file mode 100644 index 0000000..8dd2663 --- /dev/null +++ b/sysui/Cluster/Notifications.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 +import service.navigation 1.0 + +Item { + width: background.width + height: background.height + + Behavior on y { + NumberAnimation { duration: 200} + } + + Image { + id: background + source: Style.gfx("cluster/navigation_overlay") + } + + Image { + source: Style.symbol(NavigationService.nextTurnImage, 0, false) + anchors.horizontalCenter: distanceText.horizontalCenter + anchors.top: background.top + height: 50 + fillMode: Image.PreserveAspectFit + } + + Label { + id: distanceText + + anchors.verticalCenter: background.verticalCenter + anchors.left: background.left + //anchors.verticalCenterOffset: 19 + //anchors.horizontalCenterOffset: 40 + + font.pixelSize: 24 + + text: "500m" + } + + Label { + anchors.verticalCenter: background.verticalCenter + anchors.horizontalCenter: background.horizontalCenter + anchors.verticalCenterOffset: 3 + width: 325 + elide: Text.ElideRight + + font.pixelSize: 21 + textFormat: Text.StyledText + horizontalAlignment: Text.AlignHCenter + text: qsTr("<font color='%1'>NEXT:</font> %2") + .arg(Style.colorOrange) + .arg("INVALIDENSTRAßE") + } + + Row { + anchors.verticalCenter: background.verticalCenter + anchors.left: background.right + anchors.verticalCenterOffset: 19 + anchors.leftMargin: -76 + spacing: 4 + + Label { + id: timeText + + font.pixelSize: 20 + + text: "00:15" + } + } +} diff --git a/sysui/Cluster/RightDial.qml b/sysui/Cluster/RightDial.qml new file mode 100644 index 0000000..5c2c931 --- /dev/null +++ b/sysui/Cluster/RightDial.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 + +Item { + id: root + width: childrenRect.width + height: childrenRect.height + + scale: zoom ? 0.7 : 1 + property bool zoom: false + property int angle: zoom ? -45 : 0 + + Behavior on angle { + NumberAnimation { duration: 200 } + } + + Behavior on x { + NumberAnimation { duration: 200 } + } + + Behavior on scale { + NumberAnimation { duration: 200 } + } + + transform: Rotation { origin.x: root.width/2; origin.y: root.height/2; axis { x: 0; y: 1; z: 0 } angle: root.angle } + + Image { + id: background + anchors.right: parent.right + source: Style.gfx("cluster/right_dial_background") + + } + + + Dial { + id: dial + anchors.centerIn: overlay + + SequentialAnimation on value { + running: true + loops: Animation.Infinite + NumberAnimation { from: 0.15; to: 0.40; duration: 2000 } + NumberAnimation { from: 0.40; to: 0.15; duration: 1000 } + } + } + + Image { + id: overlay + anchors.top: background.top + anchors.left: background.left + anchors.topMargin: 115 + anchors.leftMargin: 208 + + source: Style.gfx("cluster/right_dial_overlay") + } +} diff --git a/sysui/Cluster/Top.qml b/sysui/Cluster/Top.qml new file mode 100644 index 0000000..59176eb --- /dev/null +++ b/sysui/Cluster/Top.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 +import controls 1.0 +import service.settings 1.0 +import service.statusbar 1.0 + +Item { + width: background.width + height: background.height + + Behavior on y { + NumberAnimation { duration: 200} + } + + Image { + id: background + source: Style.gfx("cluster/top_bar") + } + + Label { + id: timeText + + anchors.verticalCenter: background.verticalCenter + anchors.left: background.left + anchors.verticalCenterOffset: 0 + anchors.leftMargin: 162 + + font.pixelSize: 37 + font.bold: true + + text: Qt.formatTime(StatusBarService.currentDate, SettingsService.clockOption.format) + } + + Item { + anchors.verticalCenter: background.verticalCenter + anchors.horizontalCenter: background.horizontalCenter + + Row { + property int radius: 7 + anchors.centerIn: parent + anchors.verticalCenterOffset: -16 + spacing: 8 + + Rectangle { + height: parent.radius * 2 + width: parent.radius * 2 + radius: parent.radius + color: Style.colorWhite + } + + Rectangle { + height: parent.radius * 2 + width: parent.radius * 2 + radius: parent.radius + color: "#4d4d4d" + } + } + + Label { + id: navText + + anchors.centerIn: parent + anchors.verticalCenterOffset: 17 + horizontalAlignment: Text.AlignHCenter + text: StatusBarService.clusterTitle + font.pixelSize: 32 + } + } + + Label { + id: temperatureText + + anchors.verticalCenter: background.verticalCenter + anchors.left: background.right + anchors.verticalCenterOffset: 0 + anchors.leftMargin: -248 + + font.pixelSize: 37 + + text: "15\u00b0c" + } + + //Component.onCompleted: layoutTarget = navText +} diff --git a/sysui/Cluster/WidgetContainer.qml b/sysui/Cluster/WidgetContainer.qml new file mode 100644 index 0000000..22db500 --- /dev/null +++ b/sysui/Cluster/WidgetContainer.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import utils 1.0 +import com.pelagicore.ApplicationManager 0.1 + +Item { + id: root + width: 700 + height: 600 + + property string title: "" + default property alias content: container.children + + Keys.onPressed: { + if (container.children[0]) + WindowManager.setSurfaceWindowProperty(container.children[0], "keyPressed", event.key) + } + + Item { + id: container + anchors.fill: parent + } + + BorderImage { + id: rightBorder + width: sourceSize.width/5 + height: parent.height + anchors.right: parent.right + border.top: 20 + border.bottom: 20 + source: Style.gfx("cluster/right_mask") + } + + BorderImage { + id: leftBorder + width: sourceSize.width/5 + height: parent.height + anchors.left: parent.left + border.top: 20 + border.bottom: 20 + source: Style.gfx("cluster/left_mask") + } +} + diff --git a/sysui/Display.qml b/sysui/Display.qml new file mode 100644 index 0000000..8da856e --- /dev/null +++ b/sysui/Display.qml @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtGraphicalEffects 1.0 + +import controls 1.0 +import utils 1.0 +import "Climate" +import "StatusBar" + +Item { + id: root + + // Background Elements + + // Content Elements + + Component { + id: topMenu + MenuScreen { + } + } + + Item { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: Style.vspan(24-3) + + LaunchController { + id: launcher + width: Style.hspan(24) + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: statusBar.bottom + anchors.bottom: parent.bottom + initialItem: topMenu + } + + + StatusBar { + id: statusBar + anchors.left: parent.left + anchors.right: parent.right + vspan: 2 + onClicked: { + if (climateBar.expanded) { + climateBar.expanded = false + } else { + root.state = "statusBarExpanded" + } + } + + Loader { + anchors.centerIn: parent + width: Style.hspan(8); height: Style.vspan(2) + sourceComponent: launcher.currentItem ? launcher.currentItem.statusItem : undefined + } + } + } + + FastBlur { + id: fastBlur + anchors.fill: content + source: content + radius: 0 + visible: !content.visible + enabled: visible + } + + About { + id: about + anchors.bottom: parent.top; anchors.bottomMargin: height + anchors.left: parent.left; anchors.right: parent.right + vspan: 20 + onClicked: { + if (climateBar.expanded) { + climateBar.expanded = false + } else { + root.state = "" + } + } + } + + // Foreground Elements + + ClimateBar { + id: climateBar + vspan: 24-statusBar.vspan + y: expanded ? Style.vspan(statusBar.vspan) : root.height - Style.vspan(collapsedVspan) + anchors.left: parent.left + anchors.right: parent.right + + Behavior on y { + NumberAnimation { duration: 450; easing.type: Easing.OutCubic} + } + } + + + // States and Transitions + + states: [ + State { + name: "statusBarExpanded" + PropertyChanges { target: about; anchors.bottomMargin: -Style.vspan(about.vspan) } + PropertyChanges { target: content; visible: false } + PropertyChanges { target: fastBlur; radius: 100 } + } + ] + + transitions: [ + Transition { + from: ""; to: "statusBarExpanded" + ParallelAnimation { + NumberAnimation { target: about; property: "anchors.bottomMargin"; duration: 500; easing.type: Easing.OutCubic } + NumberAnimation { target: fastBlur; property: "radius"; duration: 200 } + } + }, + + Transition { + from: "statusBarExpanded"; to: "" + SequentialAnimation { + ParallelAnimation { + PropertyAction { target: content; property: "visible"; value: false } + NumberAnimation { target: fastBlur; property: "radius"; duration: 200 } + NumberAnimation { target: about; property: "anchors.bottomMargin"; duration: 500 } + } + PropertyAction { target: content; property: "visible"; value: true } + } + } + ] +} diff --git a/sysui/Home/HomePage.qml b/sysui/Home/HomePage.qml new file mode 100644 index 0000000..86eec31 --- /dev/null +++ b/sysui/Home/HomePage.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.music 1.0 +import com.pelagicore.ApplicationManager 0.1 + +UIPage { + id: root + + title: 'Home' + anchors.top: parent.top + anchors.bottom: parent.bottom + + signal showScreen(url url) + signal closeScreen() + + // Left widget side + MapWidget { + id: mapWidget + anchors.top: parent.top + anchors.left: parent.left + width: root.width/2 + vspan: 19 + } + + // Right widget side + MusicWidget { + anchors.bottom: hDiv.top + anchors.left: hDiv.left + width: root.width/2 - Style.hspan(1) + + onShowFullscreen: { + ApplicationManager.startApplication(MusicService.defaultMusicApp) + } + } + + HDiv { + id: hDiv + + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.horizontalCenter + anchors.leftMargin: Style.hspan(1) + } + + PhoneWidget { + anchors.top: hDiv.bottom + anchors.left: hDiv.left + width: root.width/2 - Style.hspan(1) + } +} diff --git a/sysui/Home/MapWidget.qml b/sysui/Home/MapWidget.qml new file mode 100644 index 0000000..50d84c7 --- /dev/null +++ b/sysui/Home/MapWidget.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 + +import controls 1.0 +import utils 1.0 + +import service.navigation 1.0 + +UIPanel { + id: root + + Item { + id: loader + anchors.fill: parent + + Image { + id: dummyBase + anchors.fill: parent + source: "heremap.png" + visible: NavigationService.defaultNavApp ? false : true + } + + Label { + id: loadingLabel + anchors.centerIn: parent + text: "Loading Map Widget ..." + visible: NavigationService.defaultNavApp ? true : false + } + + } + + Connections { + target: NavigationService + onMapWidgetChanged: { + loadingLabel.visible = false + NavigationService.mapWidget.width = loader.width + NavigationService.mapWidget.height = loader.height + loader.children = NavigationService.mapWidget + } + } +} diff --git a/sysui/Home/MusicWidget.qml b/sysui/Home/MusicWidget.qml new file mode 100644 index 0000000..959e220 --- /dev/null +++ b/sysui/Home/MusicWidget.qml @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.music 1.0 + +UIPanel { + id: root + hspan: 10 + vspan: 8 + + signal showFullscreen() + + property var track: MusicService.currentTrack + + scale: area.pressed?0.85:1.0 + + Behavior on scale { + NumberAnimation {} + } + + MouseArea { + id: area + anchors.fill: parent + onClicked: root.showFullscreen() + } + + ColumnLayout { + anchors.fill: parent + spacing: Style.padding + + Spacer { + Layout.fillHeight: true + Layout.fillWidth: true + } + + RowLayout { + spacing: 0 + + Spacer { + width: Style.hspan(0.5) + } + + ColumnLayout { + spacing: Style.paddingXS + + Label { + vspan: 1 + Layout.fillWidth: true + text: track ? qsTr('%1 / %2').arg(track.artist).arg(track.album) : "" + font.pixelSize: Style.fontSizeS + font.capitalization: Font.AllUppercase + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + } + + Label { + Layout.fillWidth: true + vspan: 1 + text: track ? track.track : "" + font.pixelSize: Style.fontSizeL + font.capitalization: Font.AllUppercase + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + } + + Label { + Layout.fillWidth: true + vspan: 1 + text: qsTr('%1 / %2').arg(MusicService.currentTime).arg(MusicService.durationTime) + font.pixelSize: Style.fontSizeL + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + } + } + + Spacer { + width: Style.hspan(0.25) + } + } + + RowLayout { + spacing: Style.hspan(1) + + Tool { + name: "prev" + vspan: 2 + Layout.fillWidth: true + onClicked: MusicService.previousTrack() + } + Tool { + vspan: 2 + Layout.fillWidth: true + name: "play" + onClicked: MusicService.musicPlay() + active: MusicService.playing + } + Tool { + vspan: 2 + Layout.fillWidth: true + name: "pause" + onClicked: MusicService.pause() + active: !MusicService.playing + } + Tool { + vspan: 2 + Layout.fillWidth: true + name: "next" + onClicked: MusicService.nextTrack() + } + } + } +} diff --git a/sysui/Home/PhoneWidget.qml b/sysui/Home/PhoneWidget.qml new file mode 100644 index 0000000..81ae3ca --- /dev/null +++ b/sysui/Home/PhoneWidget.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 + +UIPanel { + id: root + + vspan: 4 + + Icon { + id: phoneIcon + + hspan: 2; vspan: 4 + source: Style.icon("widgets_phone") + } + + RowLayout { + id: nameLayout + + anchors.top: phoneIcon.top + anchors.topMargin: Style.vspan(0.75) + anchors.left: phoneIcon.right + anchors.leftMargin: Style.padding + anchors.right: parent.right + + Label { + Layout.fillWidth: true + text: qsTr("%1 | %2").arg("John Doe").arg("02:55") + font.pixelSize: Style.fontSizeXL + font.capitalization: Font.AllUppercase + } + } + + Label { + anchors.bottom: phoneIcon.bottom + anchors.bottomMargin: Style.vspan(0.75) + anchors.left: nameLayout.left + anchors.right: nameLayout.right + + text: "555-55 55 55" + font.pixelSize: Style.fontSizeXL + } +} diff --git a/sysui/Home/heremap.png b/sysui/Home/heremap.png Binary files differnew file mode 100644 index 0000000..e04a730 --- /dev/null +++ b/sysui/Home/heremap.png diff --git a/sysui/Home/screenshot.png b/sysui/Home/screenshot.png Binary files differnew file mode 100644 index 0000000..43c54c1 --- /dev/null +++ b/sysui/Home/screenshot.png diff --git a/sysui/LaunchController.qml b/sysui/LaunchController.qml new file mode 100644 index 0000000..babb2c7 --- /dev/null +++ b/sysui/LaunchController.qml @@ -0,0 +1,274 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.0 +import controls 1.0 +import utils 1.0 +import com.pelagicore.ApplicationManager 0.1 +import service.navigation 1.0 +import service.apps 1.0 + +StackView { + id: root + width: Style.hspan(24) + height: Style.vspan(24) + + property int windowItemIndex: -1 + property Item windowItem: null + + property variant blackListItems: [] + property var minimizedItems: [] // Apps which will be started but not shown in full screen + + delegate: StackViewDelegate { + function transitionFinished(properties) + { + } + + pushTransition: StackViewTransition { + id: pushTransition + property int duration: 150 + property int intialPauseDuration: 200 + + PropertyAction { target: enterItem; property: "scale"; value: 0.0 } + PropertyAnimation { target: exitItem; property: "opacity"; to: 0.8; duration: pushTransition.intialPauseDuration } + + SequentialAnimation { + PauseAnimation { duration: pushTransition.intialPauseDuration } + ParallelAnimation { + + PropertyAnimation { + target: enterItem + property: "scale" + from: 0.1 + to: 1.0 + duration: pushTransition.duration + } + PropertyAnimation { + target: enterItem + property: "opacity" + from: 0.0 + to: 1.0 + duration: pushTransition.duration*.5 + } + PropertyAnimation { + target: exitItem + property: "scale" + from: 1.0 + to: 10.0 + duration: pushTransition.duration + } + PropertyAnimation { + target: exitItem + property: "opacity" + from: 0.8 + to: 0.0 + duration: pushTransition.duration*0.95 + } + } + } + } + + popTransition: StackViewTransition { + id: popTransition + property int duration: 150 + PropertyAnimation { + target: enterItem + property: "scale" + from: 10.0 + to: 1.0 + duration: popTransition.duration + } + PropertyAnimation { + target: enterItem + property: "opacity" + from: 0.0 + to: 1.0 + duration: popTransition.duration*.2 + } + PropertyAnimation { + target: exitItem + property: "scale" + from: 1.0 + to: 0.1 + duration: popTransition.duration + } + } + } + + function surfaceItemReadyHandler(index, item) { + print(":::LaunchController::: WindowManager:surfaceItemReadyHandler", index, item) + var isWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widgetMap") + print(":::LaunchController:::isWidget", isWidget) + var isClusterWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "clusterWidget") + print(":::LaunchController:::isClusterWidget", isClusterWidget) + + var acceptSurface = true; + var appID = WindowManager.get(index).applicationId; + + if (isWidget) { + if (ApplicationManager.get(appID).categories[0] === "navigation") { + NavigationService.mapWidget = item + } + acceptSurface = false + } + else if (isClusterWidget) { + if (ApplicationManager.get(appID).categories[0] === "navigation") { + AppsService.clusterWidgetReady("navigation", item) + } + else if (ApplicationManager.get(appID).categories[0] === "media") { + AppsService.clusterWidgetReady("media", item) + } + acceptSurface = false + } + else { + + for (var i = 0; i < root.blackListItems.length; ++i) { + if (appID === root.blackListItems[i]) + acceptSurface = false; + } + + for (var i = 0; i < root.minimizedItems.length; ++i) { + if (appID === root.minimizedItems[i]) { + acceptSurface = false; + // For now we assume that only navigation has a widget + WindowManager.setSurfaceWindowProperty(item, "windowType", "widget") + root.minimizedItems.pop(NavigationService.defaultNavApp) + break + } + } + } + + if (acceptSurface) { + root.windowItem = item + root.windowItemIndex = index + WindowManager.setSurfaceWindowProperty(item, "windowType", "fullScreen") + WindowManager.setSurfaceWindowProperty(item, "visibility", true) + + root.push(item) + } + else { + print("Not showing well known application : " + appID); + } + + } + + function surfaceItemClosingHandler(index, item) { + if (item === windowContainer.windowItem) { // start close animation + root.pop(item) + } else { + WindowManager.releaseSurfaceItem(index, item) // immediately close anything which is not handled by this container + } + } + + function surfaceItemLostHandler(index, item) { + // TODO + } + + function getSurfaceIndex(item) { + var appIndex = -1 + for (var i = 0; i < WindowManager.count; i++) { + if (WindowManager.get(i).surfaceItem === item) { + appIndex = i + break + } + } + return appIndex + } + + Connections { + target: WindowManager + onSurfaceWindowPropertyChanged: { + print(":::LaunchController::: WindowManager:surfaceWindowPropertyChanged", surfaceItem, name, value) + if (name === "visibility" && value === false) { + root.pop() + var id = root.getSurfaceIndex(root.windowItem) + if (ApplicationManager.dummy) { + if (WindowManager.get(id).categories === "navigation") + WindowManager.setSurfaceWindowProperty(root.windowItem, "windowType", "widget") + } + else { + if (ApplicationManager.get(WindowManager.get(id).applicationId).categories[0] === "navigation") { + // Sending after pop transition is done + WindowManager.setSurfaceWindowProperty(root.windowItem, "windowType", "widget") + } + } + } + else if (name === "windowType" && value === "widgetMap") { + // Workaround for qmlscene + if (ApplicationManager.dummy) { + NavigationService.mapWidget = surfaceItem + } + } + else if (name === "windowType" && value === "clusterWidget") { + // Workaround for qmlscene + if (ApplicationManager.dummy) { + AppsService.clusterWidgetReady("other", surfaceItem) + } + } + else if (name === "goTo" && value === "fullScreen") { + var appIndex = root.getSurfaceIndex(surfaceItem) + print("indexxxx", appIndex) + print(":::LaunchController::: App found. Going to full screen the app ", appIndex, WindowManager.get(appIndex).applicationId) + ApplicationManager.startApplication(WindowManager.get(appIndex).applicationId) + } + } + + onRaiseApplicationWindow: { + print(":::LaunchController::: WindowManager:raiseApplicaitonWindow" + id + " " + WindowManager.count) + for (var i = 0; i < WindowManager.count; i++) { + if (WindowManager.get(i).applicationId === id) { + var item = WindowManager.get(i).surfaceItem + print(":::LaunchController::: App found. Running the app " + id + " Item: " + item) + var isWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widget") + var isMapWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "widgetMap") + var isClusterWidget = (WindowManager.surfaceWindowProperty(item, "windowType") === "clusterWidget") + print(":::LaunchController:::isClusterWidget", isClusterWidget) + print(":::LaunchController:::isWidget", isWidget, isMapWidget) + if (!isMapWidget && !isClusterWidget) { + WindowManager.setSurfaceWindowProperty(item, "visibility", true) + WindowManager.setSurfaceWindowProperty(item, "windowType", "fullScreen") + root.windowItem = item + root.push(item) + break + } + } + } + } + } + + Component.onCompleted: { + WindowManager.surfaceItemReady.connect(surfaceItemReadyHandler) + WindowManager.surfaceItemClosing.connect(surfaceItemClosingHandler) + WindowManager.surfaceItemLost.connect(surfaceItemLostHandler) + if (NavigationService.defaultNavApp) { + root.minimizedItems.push(NavigationService.defaultNavApp) + ApplicationManager.startApplication(NavigationService.defaultNavApp) + } + } + +} diff --git a/sysui/Launcher/AppButton.qml b/sysui/Launcher/AppButton.qml new file mode 100644 index 0000000..9609175 --- /dev/null +++ b/sysui/Launcher/AppButton.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import utils 1.0 +import controls 1.0 + +UIElement { + id: root + + property alias name: nameLabel.text + property alias icon: icon.source + property bool editMode: false + property bool removable: false + property bool isUpdating: false + + // Installation progress from 0 to 1. 1 means that the application is installed. + property real installProgress: 1 + + signal clicked() + signal removeClicked() + signal pressAndHold() + + hspan: 4 + vspan: 7 + + scale: editMode ? 0.8 : 1 + + Behavior on scale { NumberAnimation { easing.type: Easing.OutBounce } } + + Rectangle { + id: background + + anchors.fill: parent + anchors.margins: 1 + color: Style.colorBlack + opacity: 0.5 + } + + Rectangle { + anchors.top: background.top + anchors.bottom: background.bottom + anchors.left: background.left + width: isUpdating ? background.width * Math.min(1.0, Math.max(0.0, installProgress)) : background.width + color: Style.colorBlack + opacity: 0.25 + + Behavior on width { SmoothedAnimation { } } + } + + Icon { + id: icon + + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: -Style.padding*3 + anchors.horizontalCenter: parent.horizontalCenter + hspan: 2 + vspan: 3 + property bool active: mouseArea.pressed && !root.editMode && root.installProgress >= 1.0 + opacity: installProgress < 1.0 && installProgress > 0.0 ? 0.4 : 1.0 + visible: root.icon + + Behavior on opacity { NumberAnimation { } } + } + + Label { + id: nameLabel + + width: parent.width + anchors.bottom: parent.bottom + anchors.bottomMargin: Style.padding*3 + + horizontalAlignment: Qt.AlignHCenter + font.pixelSize: Style.fontSizeM + opacity: icon.opacity + } + + MouseArea { + id: mouseArea + + anchors.fill: parent + onClicked: root.clicked() + onPressAndHold: root.pressAndHold() + } + + Symbol { + id: removeIcon + + anchors.verticalCenter: background.top + anchors.horizontalCenter: background.right + + name: "close" + size: Style.symbolSizeS + visible: root.editMode && root.removable + active: removeMouseArea.pressed + scale: active ? 0.8 : 1 + } + + MouseArea { + id: removeMouseArea + + anchors.fill: removeIcon + enabled: root.editMode && root.removable + onClicked: root.removeClicked() + } +} diff --git a/sysui/Launcher/LauncherPage.qml b/sysui/Launcher/LauncherPage.qml new file mode 100644 index 0000000..7d41499 --- /dev/null +++ b/sysui/Launcher/LauncherPage.qml @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.apps 1.0 + +import com.pelagicore.ApplicationManager 0.1 +import com.pelagicore.ApplicationInstaller 0.1 + +UIPage { + id: root + hspan: 24 + vspan: 21 + + title: qsTr("App Launcher") + symbolName: "apps" + + signal updateApp() + + GridView { + id: view + + property bool editMode: false + property int columns: root.width/Style.hspan(4) + + anchors.top: parent.top + anchors.topMargin: Style.vspan(3) + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + width: cellWidth*columns + + clip: true + cellWidth: Style.hspan(4) + cellHeight: Style.vspan(7) + + model: ApplicationManager + + flickableChildren: MouseArea { + anchors.fill: parent + onClicked: view.editMode = false + } + + add: Transition { + NumberAnimation { properties: "opacity, scale"; from: 0; to: 1 } + } + + remove: Transition { + NumberAnimation { properties: "opacity, scale"; to: 0 } + } + + displaced: Transition { + NumberAnimation { properties: "x,y"; duration: 200 } + } + + delegate: AppButton { + width: view.cellWidth + height: view.cellHeight + + name: model.name + icon: Qt.resolvedUrl(model.icon) + + editMode: view.editMode + removable: model.isRemovable + installProgress: model.updateProgress + isUpdating: model.isUpdating + + onIsUpdatingChanged: { + if (isUpdating) + root.updateApp() + } + + onClicked: { + if (view.editMode) { + view.editMode = false + } else { + if (!model.isUpdating) + console.log("Starting app " + model.applicationId + ": " + ApplicationManager.startApplication(model.applicationId)); + } + } + + onRemoveClicked: { + ApplicationInstaller.removePackage(model.applicationId, false /*keepDocuments*/, true /*force*/) + } + onPressAndHold: view.editMode = true + } + } +} diff --git a/sysui/MenuScreen.qml b/sysui/MenuScreen.qml new file mode 100644 index 0000000..4cfc65b --- /dev/null +++ b/sysui/MenuScreen.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQml.Models 2.1 +import controls 1.0 +import utils 1.0 +import "MyCar" +import "Settings" +import "Home" +import "Launcher" +import "Cloud" + +PageSwipeScreen { + id: root + + title: currentItem.title + + function showScreen(url) { + Stack.view.push(url) + } + + function closeScreen() { + Stack.view.pop() + } + + statusItem: PageIndicator { + count: root.count + currentIndex: root.currentIndex + onClicked: { + root.currentIndex = index + } + } + + itemWidth: Style.hspan(24) + + currentIndex: Math.floor(root.count/2) + + items: ObjectModel { + MyCarPage { + width: root.itemWidth + height: root.height + } + FunctionsPage { + width: root.itemWidth + height: root.height + } + HomePage { + width: root.itemWidth + height: root.height + onShowScreen: root.showScreen(url) + onCloseScreen: root.closeScreen() + } + LauncherPage { + id: launcher + width: root.itemWidth + height: root.height + onUpdateApp: currentIndex = 3 + } + CloudPage { + width: root.itemWidth + height: root.height + } + } +} diff --git a/sysui/MyCar/MyCarOverview.qml b/sysui/MyCar/MyCarOverview.qml new file mode 100644 index 0000000..9475712 --- /dev/null +++ b/sysui/MyCar/MyCarOverview.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + RowLayout { + id: content + + spacing: 0 + anchors.top: parent.top + anchors.topMargin: Style.vspan(1) + anchors.horizontalCenter: parent.horizontalCenter + height: parent.height + + ListViewManager { + id: view + + width: Style.hspan(5) + Layout.fillHeight: true + + model: ListModel { + ListElement { name: "Tire Pressure Monitor"; symbol: ""; slide: "Status" } + ListElement { name: "Warning"; symbol: "tire_pressure"; slide: "TireFault" } + ListElement { name: "Trunk Open"; symbol: "trunk_open"; slide: "HatchFault" } + ListElement { name: "Door Open"; symbol: "door_open"; slide: "DoorFault" } + ListElement { name: "Car Color"; symbol: ""; slide: "" } + } + + delegate: CategoryListItem { + width: ListView.view.width + height: Style.vspan(3) + + text: model.name.toUpperCase() + symbol: model.symbol + + onClicked: { + view.currentIndex = index + } + } + } + + UIElement { + id: composerParent + hspan: 11 + Layout.fillHeight: true + + Loader { + width: parent.width + height: Style.vspan(15) + sourceComponent: carDemo + } + } + } + + Component { + id: carDemo + Image { + source: "white.png" + } + } +} diff --git a/sysui/MyCar/MyCarPage.qml b/sysui/MyCar/MyCarPage.qml new file mode 100644 index 0000000..20db78a --- /dev/null +++ b/sysui/MyCar/MyCarPage.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 + +UIPage { + id: root + hspan: 24 + vspan: 24 + + title: 'My Car' + symbolName: "information" + + TabView { + id: tabView + anchors.fill: parent + tabs: [ + { title : "OVERVIEW", url : Qt.resolvedUrl("MyCarOverview.qml"), properties : {} }, + { title : "OWNERS MANUAL", url : Qt.resolvedUrl("OwnersManual.qml"), properties : {} }, + ] + } +} diff --git a/sysui/MyCar/OwnersManual.qml b/sysui/MyCar/OwnersManual.qml new file mode 100644 index 0000000..5ded142 --- /dev/null +++ b/sysui/MyCar/OwnersManual.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + hspan: 18 + vspan: 24 + + ListViewManager { + id: settingsListView + + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: Style.vspan(1) + hspan: 12 + height: parent.height + + model: ListModel { + ListElement { title: "Steering wheel gearshift paddles" } + ListElement { title: "Combination switch" } + ListElement { title: "Instrument cluster" } + ListElement { title: "Horn" } + ListElement { title: "DIRECT SELECT lever" } + ListElement { title: "PARKTRONIC warning display" } + ListElement { title: "Overhead control panel" } + } + + delegate: SettingsListItem { + hspan: settingsListView.hspan + vspan: 2 + checkedEnabled: false + iconName: "information" + titleText: model.title + } + } +} diff --git a/sysui/MyCar/white.png b/sysui/MyCar/white.png Binary files differnew file mode 100644 index 0000000..a181253 --- /dev/null +++ b/sysui/MyCar/white.png diff --git a/sysui/Settings/BooleanSetting.qml b/sysui/Settings/BooleanSetting.qml new file mode 100644 index 0000000..4ca24e8 --- /dev/null +++ b/sysui/Settings/BooleanSetting.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 + +UIElement { + id: wrapper + + property var option + + Row { + anchors.verticalCenter: parent.verticalCenter + + Label { + id: titleLabel + + hspan: 10; vspan: 2 + text: option.name + font.pixelSize: Style.fontSizeXL + font.capitalization: Font.AllUppercase + } + + Switch { + checked: option.active + onCheckedChanged: option.active = checked + } + } + + HDiv { + anchors.verticalCenter: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + _tracer_color: 'transparent' + } + + MouseArea { + anchors.fill: parent + onClicked: option.active = !option.active + } +} diff --git a/sysui/Settings/FunctionsPage.qml b/sysui/Settings/FunctionsPage.qml new file mode 100644 index 0000000..d12cae8 --- /dev/null +++ b/sysui/Settings/FunctionsPage.qml @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtGraphicalEffects 1.0 + +import controls 1.0 +import utils 1.0 +import service.settings 1.0 + +UIPage { + id: root + hspan: 24 + vspan: 24 + + title: qsTr('Car Settings') + symbolName: "settings" + + GridView { + id: view + + anchors.top: parent.top + anchors.topMargin: Style.vspan(2) + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + + width: Style.hspan(6*3) + + model: SettingsService.functions + + clip: false // true + + cellWidth: Style.hspan(6) + cellHeight: Style.vspan(5) + + delegate: Item { + property bool active: model.active + + width: view.cellWidth + height: view.cellHeight + + HDiv { + id: div + width: parent.width + vspan: 1 + } + + RowLayout { + spacing: Style.paddingXL + anchors.top: div.bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 4 + + Item { + Layout.preferredWidth: rect.width + Layout.preferredHeight: parent.height + + RectangularGlow { + anchors.fill: rect + glowRadius: 5 + spread: 0 + color: Style.colorOrange + cornerRadius: 10 + visible: active + } + + Rectangle { + id: rect + color: active ? Style.colorOrange : "#444" + width: 4 + radius: 2 + height: parent.height + } + } + + Image { + source: Style.symbolM(model.icon) + } + + Label { + Layout.fillHeight: true + Layout.fillWidth: true + text: model.description + wrapMode: Text.WordWrap + } + } + + MouseArea { + anchors.fill: parent + onClicked: active = !active + } + } + } +} diff --git a/sysui/Settings/MultiValueSetting.qml b/sysui/Settings/MultiValueSetting.qml new file mode 100644 index 0000000..41c1842 --- /dev/null +++ b/sysui/Settings/MultiValueSetting.qml @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import controls 1.0 +import utils 1.0 + +UIElement { + id: wrapper + + property var option + + Row { + anchors.verticalCenter: parent.verticalCenter + + Label { + id: titleLabel + + hspan: 10; vspan: 2 + text: option.name + font.capitalization: Font.AllUppercase + font.pixelSize: Style.fontSizeXL + } + + PathView { + id: optionsView + + width: Style.hspan(3) + height: Style.vspan(2) + + model: option.options + + pathItemCount: 1 + clip: true + interactive: false + + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + + onCurrentIndexChanged: option.active = currentIndex + + delegate: Label { + width: optionsView.width + vspan: 2 + text: modelData + color: Style.colorOrange + horizontalAlignment: Qt.AlignRight + font.pixelSize: Style.fontSizeXL + } + + path: Path { + startX: 0 + startY: optionsView.height/2 + + PathLine { + x: optionsView.width + y: optionsView.height/2 + } + } + } + + Tool { + name: "arrow_right" + onClicked: optionsView.decrementCurrentIndex() + size: Style.symbolSizeXS + } + } + + HDiv { + anchors.verticalCenter: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + _tracer_color: 'transparent' + } + + MouseArea { + anchors.fill: parent + onClicked: optionsView.decrementCurrentIndex() + } +} diff --git a/sysui/Settings/SettingsPage.qml b/sysui/Settings/SettingsPage.qml new file mode 100644 index 0000000..384065e --- /dev/null +++ b/sysui/Settings/SettingsPage.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import controls 1.0 +import utils 1.0 +import service.settings 1.0 + +UIPage { + id: root + + hspan: 24 + vspan: 24 + + title: qsTr('Car Settings') + symbolName: "settings" + + + ListView { + id: settingsListView + + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: Style.vspan(2) + anchors.bottom: parent.bottom + width: Style.hspan(14) + + clip: true + model: SettingsService.carSettings + + delegate: Loader { + width: ListView.view.width + height: Style.vspan(2) + + sourceComponent: modelData.option.options ? multiValueSetting : booleanSetting + asynchronous: true + onLoaded: item.option = modelData.option + } + } + + Image { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + source: Style.icon('cloud_bottom_shadow') + asynchronous: true + visible: false + } + + Component { + id: multiValueSetting + + MultiValueSetting { + } + } + + Component { + id: booleanSetting + + BooleanSetting { + } + } +} diff --git a/sysui/StatusBar/DateAndTime.qml b/sysui/StatusBar/DateAndTime.qml new file mode 100644 index 0000000..bff8151 --- /dev/null +++ b/sysui/StatusBar/DateAndTime.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import utils 1.0 + +UIElement { + id: root + + property string timeFormat: "hh:mm" + property var currentDate: new Date() + + hspan: 4 + vspan: 2 + + RowLayout { + anchors.top: parent.top + anchors.right: parent.right + spacing: Style.padding + + Text { + id: clock + Layout.preferredHeight: root.height + verticalAlignment: Text.AlignVCenter + + font.family: Style.fontFamily + font.weight: Font.Light + font.pixelSize: Style.fontSizeXXL + + color: Style.colorWhite + + text: Qt.formatTime(root.currentDate, root.timeFormat) + } + + Item { + anchors.top: clock.top + anchors.bottom: clock.bottom + anchors.topMargin: Style.vspan(1) === 33 ? 4 : 9 + anchors.bottomMargin: Style.vspan(1) === 33 ? 3 : 5 + + width: Style.hspan(1) + + Text { + anchors.top: parent.top + + font.family: Style.fontFamily + font.pixelSize: Style.fontSizeS + font.capitalization: Font.AllUppercase + + color: Style.colorWhite + + text: Qt.formatDate(root.currentDate, 'ddd') + } + + Text { + anchors.bottom: parent.bottom + + font.family: Style.fontFamily + font.pixelSize: Style.fontSizeS + font.capitalization: Font.AllUppercase + + color: Style.colorWhite + + text: Qt.formatDate(root.currentDate, 'MMM d') + } + } + } +} diff --git a/sysui/StatusBar/IndicatorTray.qml b/sysui/StatusBar/IndicatorTray.qml new file mode 100644 index 0000000..922ba44 --- /dev/null +++ b/sysui/StatusBar/IndicatorTray.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import controls 1.0 +import utils 1.0 + +UIElement { + id: root + + property alias model: repeater.model + + hspan: model ? model.length : 0 + vspan: 2 + + RowLayout { + spacing: Style.paddingXL + height: parent.height + + Repeater { + id: repeater + + delegate: Image { + source: Style.symbolXS(modelData.name) + opacity: modelData.active ? 1 : 0.4 + } + } + } +} diff --git a/sysui/StatusBar/StatusBar.qml b/sysui/StatusBar/StatusBar.qml new file mode 100644 index 0000000..becce44 --- /dev/null +++ b/sysui/StatusBar/StatusBar.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 + +import utils 1.0 +import service.statusbar 1.0 +import service.settings 1.0 + +UIElement { + id: root + hspan: 24 + vspan: 2 + signal clicked() + + MouseArea { + anchors.fill: parent + onClicked: root.clicked() + } + + Rectangle { + id: background + anchors.fill: parent + color: Style.colorBlack + opacity: 0.7 + } + + RowLayout { + id: layout + spacing: Style.padding + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.topMargin: Style.padding + anchors.bottomMargin: Style.padding + + width: Style.hspan(23) + + IndicatorTray { + Layout.fillHeight: true + model: StatusBarService.indicators + } + + Spacer { + Layout.fillHeight: true + Layout.fillWidth: true + } + + Weather { + Layout.fillHeight: true + currentTemperature: 15 + weatherIcon: "topbar_icon_rain" + } + + DateAndTime { + Layout.preferredWidth: Style.hspan(timeFormat.length <= 5 ? 3 : 4) + Layout.fillHeight: true + timeFormat: SettingsService.clockOption.format + currentDate: StatusBarService.currentDate + } + } +} diff --git a/sysui/StatusBar/Weather.qml b/sysui/StatusBar/Weather.qml new file mode 100644 index 0000000..a24ec60 --- /dev/null +++ b/sysui/StatusBar/Weather.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.pelagicore.com/ +** +** This file is part of Neptune IVI UI. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Neptune IVI UI 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 Pelagicore. For licensing terms +** and conditions see http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import utils 1.0 + +UIElement { + id: root + + property int currentTemperature: 0 + property string weatherIcon + + hspan: 2 + vspan: 2 + + RowLayout { + spacing: Style.paddingL + anchors.centerIn: parent + + Image { + source: Style.icon(weatherIcon) + asynchronous: true + } + + Text { + font.family: Style.fontFamily + font.pixelSize: Style.fontSizeL + + color: Style.colorWhite + + text: qsTr("%1°c").arg(root.currentTemperature) + + clip: Style.debugMode + font.weight: Style.fontWeight + } + } +} |