diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-06-20 16:30:25 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-06-24 14:47:34 +0000 |
commit | 894c8e66c643bd4803c606545a35239ce1350fd2 (patch) | |
tree | 541ea48bedf616038ae39ad1e607991d210b32be /src/remotesettings | |
parent | 214eaf3c353c7bae0616ac66b3af8cc8fec56aa3 (diff) |
[companion-app] Update UX for dev page
Change-Id: I3f578669a11293bd4a472ebd207789908ec57ba2
Fixes: AUTOSUITE-1035
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r-- | src/remotesettings/app/DevelopmentPage.qml | 154 | ||||
-rw-r--r-- | src/remotesettings/app/MapsPage.qml (renamed from src/remotesettings/app/NaviPage.qml) | 0 | ||||
-rw-r--r-- | src/remotesettings/app/VehiclePage.qml | 6 | ||||
-rw-r--r-- | src/remotesettings/app/app.pro | 2 | ||||
-rw-r--r-- | src/remotesettings/app/assets/maps.png (renamed from src/remotesettings/app/assets/navi.png) | 0 | ||||
-rw-r--r-- | src/remotesettings/app/client.cpp | 7 | ||||
-rw-r--r-- | src/remotesettings/app/main.cpp | 3 | ||||
-rw-r--r-- | src/remotesettings/app/main.qml | 10 | ||||
-rw-r--r-- | src/remotesettings/app/qml.qrc | 4 |
9 files changed, 88 insertions, 98 deletions
diff --git a/src/remotesettings/app/DevelopmentPage.qml b/src/remotesettings/app/DevelopmentPage.qml index bf3bb1ac..03b8a4f0 100644 --- a/src/remotesettings/app/DevelopmentPage.qml +++ b/src/remotesettings/app/DevelopmentPage.qml @@ -37,12 +37,17 @@ Flickable { id: root flickableDirection: Flickable.VerticalFlick contentHeight: baseLayout.height - ScrollIndicator.vertical: ScrollIndicator { } + ScrollIndicator.vertical: ScrollIndicator { + active: true + // we want always see it if the content doesnt fit view + onActiveChanged: active = true + } ColumnLayout { id: baseLayout anchors.centerIn: parent + spacing: 20 ColumnLayout { enabled: systemUI.isInitialized && client.connected @@ -59,7 +64,7 @@ Flickable { text: qsTr("Show Next Application IC Window"); onClicked: { systemUI.applicationICWindowSwitchCount = - systemUI.applicationICWindowSwitchCount + 1 + systemUI.applicationICWindowSwitchCount + 1 } } @@ -88,15 +93,25 @@ Flickable { } + Label { + text: "Vehicle state" + Layout.alignment: Qt.AlignHCenter + font.bold: true + } + GridLayout { enabled: instrumentCluster.isConnected Layout.alignment: Qt.AlignHCenter - columns: root.width < neptuneScale(100) ? 2 : 4 + columns: root.width > 2 * (outsideTemperatureLabel.width + outsideTemperature.width + columnSpacing) + ? 4 : 2 + + columnSpacing: 15 + rowSpacing: 20 //Outside Temperature Label { - text: qsTr("Outside \n temperature: " - + outsideTemperature.value.toFixed(1).padStart(6) + " °C") + id: outsideTemperatureLabel + text: qsTr("Outside \n temperature, °C") } Slider { id: outsideTemperature @@ -109,6 +124,12 @@ Flickable { instrumentCluster.outsideTemperatureCelsius = value } } + + Label { + anchors.centerIn: parent.handle + anchors.verticalCenterOffset: - parent.handle.height * 2 + text: parent.value.toFixed(1).padStart(6) + } } // Mileage in km @@ -122,13 +143,18 @@ Flickable { stepSize: 0.5 to: 9E6 onValueChanged: if (pressed) { instrumentCluster.mileageKm = value } + + Label { + anchors.centerIn: parent.handle + anchors.verticalCenterOffset: - parent.handle.height * 2 + text: parent.value + } } // Route progress Label { - text: qsTr("Route \n progress, %:") + text: qsTr("Route \n progress, %") } - Slider { id: routeProgressSlider from: 0 @@ -141,6 +167,11 @@ Flickable { } } + Label { + anchors.centerIn: parent.handle + anchors.verticalCenterOffset: - parent.handle.height * 2 + text: parent.value.toFixed(2) + } } // Route distance @@ -158,9 +189,16 @@ Flickable { instrumentCluster.navigationRouteDistanceKm = value } } + + Label { + anchors.centerIn: parent.handle + anchors.verticalCenterOffset: - parent.handle.height * 2 + text: parent.value + } } }//grid + RowLayout { enabled: instrumentCluster.isConnected Layout.alignment: Qt.AlignHCenter @@ -177,104 +215,35 @@ Flickable { } } + // readonly state GridLayout { Layout.alignment: Qt.AlignHCenter - columns: root.width < neptuneScale(100) ? 2 : 4 - enabled: false + columns: 2 + columnSpacing: 50 + rowSpacing: 25 // speedLimit Field - Dial { - id: speedLimitDial - from: 0 - to: 260 - stepSize: 1.0 - value: instrumentCluster.speedLimit - - - Label { - text: qsTr("Speed limit:") - anchors.bottom: speedLimitDial.verticalCenter - anchors.horizontalCenter: speedLimitDial.horizontalCenter - } - - Label { - id: speedLimitLabel - text: Math.round(speedLimitDial.value) - anchors.top: speedLimitDial.verticalCenter - anchors.horizontalCenter: speedLimitDial.horizontalCenter - } + Label { + text: qsTr("Speed limit: ") + instrumentCluster.speedLimit } - // speedCruise Field - Dial { - id: speedCruiseDial - from: 0 - to: 260 - stepSize: 1.0 - value: instrumentCluster.speedCruise - - Label { - text: qsTr("Cruise speed:") - anchors.bottom: speedCruiseDial.verticalCenter - anchors.horizontalCenter: speedCruiseDial.horizontalCenter - } - - Label { - id: speedCruiseLabel - text: Math.round(speedCruiseDial.value) - anchors.top: speedCruiseDial.verticalCenter - anchors.horizontalCenter: speedCruiseDial.horizontalCenter - } + Label { + text: qsTr("Cruise speed: ") + instrumentCluster.speedCruise } - // speed Field - Dial { - id: speedDial - from: 0 - to: 260 - stepSize: 1.0 - value: instrumentCluster.speed - - Label { - text: qsTr("Speed:") - anchors.bottom: speedDial.verticalCenter - anchors.horizontalCenter: speedDial.horizontalCenter - } - - Label { - id: speedLabel - text: Math.round(speedDial.value) - anchors.top: speedDial.verticalCenter - anchors.horizontalCenter: speedDial.horizontalCenter - } + Label { + text: qsTr("Speed: ") + instrumentCluster.speed } - // ePower Field - Dial { - id: ePowerDial - from: -25 - to: 100 - stepSize: 1.0 - value: instrumentCluster.ePower - - Label { - text: qsTr("ePower:") - anchors.bottom: ePowerDial.verticalCenter - anchors.horizontalCenter: ePowerDial.horizontalCenter - } - - Label { - id: ePowerLabel - text: Math.round(ePowerDial.value) - anchors.top: ePowerDial.verticalCenter - anchors.horizontalCenter: ePowerDial.horizontalCenter - } + Label { + text: qsTr("ePower: ") + instrumentCluster.ePower } } RowLayout { enabled: instrumentCluster.isConnected Layout.alignment: Qt.AlignHCenter + spacing: 50 //Driving mode range Field Dial { @@ -469,7 +438,12 @@ Flickable { } Label { - text: qsTr("Neptune Revision: ") + neptuneInfo + text: qsTr("Neptune Revision: ") + neptuneGitRevision + Layout.alignment: Qt.AlignHCenter + } + + Label { + text: qsTr("Neptune Revision Date: ") + neptuneGitCommiterDate Layout.alignment: Qt.AlignHCenter } diff --git a/src/remotesettings/app/NaviPage.qml b/src/remotesettings/app/MapsPage.qml index c9969db5..c9969db5 100644 --- a/src/remotesettings/app/NaviPage.qml +++ b/src/remotesettings/app/MapsPage.qml diff --git a/src/remotesettings/app/VehiclePage.qml b/src/remotesettings/app/VehiclePage.qml index cce6267b..71b6df59 100644 --- a/src/remotesettings/app/VehiclePage.qml +++ b/src/remotesettings/app/VehiclePage.qml @@ -38,7 +38,11 @@ Flickable { flickableDirection: Flickable.VerticalFlick contentHeight: baseLayout.height - ScrollIndicator.vertical: ScrollIndicator { } + ScrollIndicator.vertical: ScrollIndicator { + active: true + // we want always see it if the content doesnt fit view + onActiveChanged: active = true + } ColumnLayout { id: baseLayout diff --git a/src/remotesettings/app/app.pro b/src/remotesettings/app/app.pro index 2aece47b..de829727 100644 --- a/src/remotesettings/app/app.pro +++ b/src/remotesettings/app/app.pro @@ -17,6 +17,8 @@ isEmpty(GIT_REVISION) { } DEFINES *= "NEPTUNE_COMPANION_APP_VERSION=$$VERSION" +DEFINES *= "NEPTUNE_GIT_REVISION=\"$$GIT_REVISION\"" +DEFINES *= "NEPTUNE_REVISION_DATE=\"$$GIT_COMMITTER_DATE\"" DEFINES *= NEPTUNE_INFO=\""\\\"$$GIT_REVISION, $$GIT_COMMITTER_DATE\\\""\" LIBS += -L$$LIB_DESTDIR -l$$qtLibraryTarget(remotesettings) diff --git a/src/remotesettings/app/assets/navi.png b/src/remotesettings/app/assets/maps.png index 807797da..807797da 100644 --- a/src/remotesettings/app/assets/navi.png +++ b/src/remotesettings/app/assets/maps.png diff --git a/src/remotesettings/app/client.cpp b/src/remotesettings/app/client.cpp index e2ef3b84..876c47fa 100644 --- a/src/remotesettings/app/client.cpp +++ b/src/remotesettings/app/client.cpp @@ -199,8 +199,13 @@ void Client::readSettings() int size=m_settings.beginReadArray(settingsLastUrlsPrefix); for (int i=0; i<size; i++) { m_settings.setArrayIndex(i); - m_lastUrls.append(m_settings.value(settingsLastUrlsItem).toString()); + auto url = QUrl(m_settings.value(settingsLastUrlsItem).toString()); + if (url.isValid() && !url.scheme().isEmpty()) { + url.setPort(-1); + m_lastUrls.append(url.toString(QUrl::None)); + } } + m_settings.endArray(); emit lastUrlsChanged(m_lastUrls); } diff --git a/src/remotesettings/app/main.cpp b/src/remotesettings/app/main.cpp index 271320f0..84bf4a2a 100644 --- a/src/remotesettings/app/main.cpp +++ b/src/remotesettings/app/main.cpp @@ -51,7 +51,8 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; engine.addImportPath(QDir::currentPath()+QStringLiteral("/imports_shared/")); engine.rootContext()->setContextProperty(QStringLiteral("client"), &client); - engine.rootContext()->setContextProperty("neptuneInfo", STR(NEPTUNE_INFO)); + engine.rootContext()->setContextProperty("neptuneGitRevision", STR(NEPTUNE_GIT_REVISION)); + engine.rootContext()->setContextProperty("neptuneGitCommiterDate", STR(NEPTUNE_REVISION_DATE)); engine.rootContext()->setContextProperty("qtiviVersion", QTIVICORE_VERSION_STR); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) diff --git a/src/remotesettings/app/main.qml b/src/remotesettings/app/main.qml index 3e0385da..26d44566 100644 --- a/src/remotesettings/app/main.qml +++ b/src/remotesettings/app/main.qml @@ -44,6 +44,9 @@ ApplicationWindow { visible: true width: 1280 height: 800 + minimumHeight: 720 + minimumWidth: 400 + title: qsTr("Neptune Companion App") readonly property color accentColor: "#FA9E54" @@ -69,6 +72,7 @@ ApplicationWindow { onIsInitializedChanged: { isConnected = isInitialized; } + onErrorChanged: { if (error > 0) { //Any other state then NoError=0 @@ -156,7 +160,7 @@ ApplicationWindow { VehiclePage {} MediaPage {} - NaviPage {} + MapsPage {} SettingsPage {} DevelopmentPage {} } @@ -179,8 +183,8 @@ ApplicationWindow { onClicked: stack.currentIndex = 1 } TabButton { - icon.source: "qrc:/assets/navi.png" - text: qsTr("Navi") + icon.source: "qrc:/assets/maps.png" + text: qsTr("Maps") icon.color: instrumentCluster.isConnected ? root.accentColor : root.disconnectedColor display: AbstractButton.TextUnderIcon font.capitalization: Font.MixedCase diff --git a/src/remotesettings/app/qml.qrc b/src/remotesettings/app/qml.qrc index 5161fe5f..1e2f497e 100644 --- a/src/remotesettings/app/qml.qrc +++ b/src/remotesettings/app/qml.qrc @@ -7,11 +7,11 @@ <file>DevelopmentPage.qml</file> <file>MediaPage.qml</file> <file>VehiclePage.qml</file> - <file>NaviPage.qml</file> + <file>MapsPage.qml</file> <file>assets/vehicle.png</file> <file>assets/media.png</file> <file>assets/settings.png</file> - <file>assets/navi.png</file> + <file>assets/maps.png</file> <file>assets/development.png</file> <file>Vehicle2DPanel.qml</file> <file>assets/ic_background.png</file> |