Commit 01a503bc authored by Ionut Alexandrescu's avatar Ionut Alexandrescu

Add the TitilliumWeb font and set it as default

Update the Select dial assets
Add an Authentication page
Add the same style to Charging as Select
parent 2303b694
Assets/Select/EVCS_dial_554x220.png

31.7 KB | W: | H:

Assets/Select/EVCS_dial_554x220.png

31.5 KB | W: | H:

Assets/Select/EVCS_dial_554x220.png
Assets/Select/EVCS_dial_554x220.png
Assets/Select/EVCS_dial_554x220.png
Assets/Select/EVCS_dial_554x220.png
  • 2-up
  • Swipe
  • Onion skin
import QtQuick 2.6
import QtQuick.Controls 2.1
import App 1.0
Rectangle
{
property alias textField: textFieldItem
width: 200
height: 40
color: "#0b2a4a"
border.color: "#0a0f2c"
radius: 10
TextInput
{
id: textFieldItem
anchors.fill: parent
anchors.leftMargin: 10
anchors.topMargin: 5
//text: qsTr("Enter")
font.pixelSize: 20
color: "#42cc53"
}
}
......@@ -9,6 +9,8 @@ Item {
property bool indicatorText: true;
property alias chargingVisible: chargeSpinBox.visible
function setChargeValue( value )
{
chargeSpinBox.from = value;
......
import QtQuick 2.8
import QtQuick.Controls 2.0
Page {
id: root
signal nextPage
background: Item {
anchors.horizontalCenter: parent.horizontalCenter
y:2
width: 760
height: 400
Rectangle {
id: backRectange
anchors.fill: parent
color: "#B8BBC5"
opacity: 0.5
}
Grid {
anchors.centerIn: backRectange
rows: 2
columns: 2
spacing: 20
Text {
id: text1
text: qsTr("Username:")
font.pointSize: 20
color: "#0a0f2c"
}
AuthenticationTextInput {
id: textInput
}
Text {
id: text2
text: qsTr("Password:")
font.pointSize: 20
color: "#0a0f2c"
}
AuthenticationTextInput {
id: textInput1
textField.echoMode:TextInput.Password
}
}
Button {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: 350
height: 45
flat: true
contentItem: Label {
color: "#00DB52"
text: qsTr("USER AUTHENTICATION")
font.pixelSize: 18
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
anchors.fill: parent
color: "#0E1039"
}
onReleased: root.nextPage()
}
}
}
......@@ -7,15 +7,31 @@ Page {
id: root
property alias batteryInfo: battery
function initializeValues()
{
infoText.text = qsTr( "Charging" )
battery.initializeValues();
}
signal signalChargeCompleted();
Component.onCompleted:
{
spinBoxes.indicatorText = false;
spinBoxes.chargingVisible = false;
}
background: Item {
Image {
x: 40
y: 60
width: 554
height: 240
fillMode: Image.PreserveAspectFit
source: "Assets/Select/EVCS_dial_554x220_top.png"
}
InfoSpinBoxes
{
id: spinBoxes
......@@ -24,6 +40,19 @@ Page {
width:230
height: 150
Text
{
id: chargingText
color: "#42cc53"
text: qsTr( "Charging in progress" )
width: 230
height: 34
x: 20
font.pointSize: 16
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
}
}
Battery
......@@ -34,28 +63,38 @@ Page {
onChargedPercentageChanged :
{
spinBoxes.setChargeValue( chargedPercentage * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - chargedPercentage ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( chargedPercentage - battery.initialCharge) * Variables.priceOnePercent * 100 )
updateSpinBoxes( chargedPercentage )
}
onSignalChargeCompleted:
{
spinBoxes.setChargeValue( chargedPercentage * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - chargedPercentage ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( chargedPercentage - battery.initialCharge) * Variables.priceOnePercent * 100 )
updateSpinBoxes( chargedPercentage )
chargingText.text = qsTr( "Charging Complete" )
root.signalChargeCompleted();
}
function updateSpinBoxes( value )
{
var strvalue = Number(Math.floor(value)).toLocaleString(locale, 'f', 0) + "%";
if ( value < 10 )
strvalue = "0" + strvalue;
infoText.text = strvalue;
spinBoxes.setChargeValue( value * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - value ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( value - battery.initialCharge) * Variables.priceOnePercent * 100 )
}
}
Text
{
x: 50
id: infoText
x: 120
anchors.verticalCenter: parent.verticalCenter
color: "#ffffff"
text: qsTr("Charging")
font.pointSize: 36
font.bold: true
color: "#42cc53"
text: "00%"
font.pointSize: 38
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
}
}
......@@ -45,7 +45,6 @@ Page
anchors.left: textEnterPIN.right
anchors.top: textEnterPIN.top
anchors.bottom: textEnterPIN.bottom
anchors.bottomMargin: -5
anchors.leftMargin: 10
border.width: 2
color: "transparent"
......@@ -59,6 +58,7 @@ Page
text: ""
font.pointSize: 18
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: Text.AlignVCenter
function clear()
{
......
......@@ -20,6 +20,7 @@ Popup {
property variant decriptions:
[
qsTr( "Please tap to start for entering your credentials and start charging your car" ),
qsTr( "Please enter your credential in the system" ),
qsTr( "Please set the charge that you want achieve using the rotational Knob" ),
qsTr( "Please add your pin number in order to start the charge" ),
qsTr( "Charging information status" )
......
......@@ -15,10 +15,10 @@ SpinBoxBase
}
textFromValue: function(value, locale) {
return Number(value / 100).toLocaleString(locale, 'f', infoSpinBox.decimals)
return Number(value / 100).toLocaleString(locale, 'f', infoSpinBox.decimals) + "%"
}
valueFromText: function(text, locale) {
return Number.fromLocaleString(locale, text) * 100
return Number.fromLocaleString(locale, text.substring(0, text.lenght-1)) * 100
}
}
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QFontDatabase>
int main(int argc, char *argv[])
{
......@@ -8,6 +9,21 @@ int main(int argc, char *argv[])
//QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-Black.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-Bold.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-BoldItalic.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-ExtraLight.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-ExtraLightItalic.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-Italic.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-Light.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-LightItalic.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-Regular.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-SemiBold.ttf" );
QFontDatabase::addApplicationFont( ":/Assets/Fonts/TitilliumWeb-SemiBoldItalic.ttf" );
QFont font( "Titillium Web" );
QGuiApplication::setFont(font);
qmlRegisterSingletonType(QUrl("qrc:///Variables.qml"), "App", 1, 0, "Variables");
QQmlApplicationEngine engine;
......
......@@ -40,7 +40,7 @@ ApplicationWindow {
id: footerItem
height: 63
pageIndicatorcount: swipeView.count - 1
onRightButtonReleased: swipeView.currentIndex == 3 ? swipeView.setCurrentIndex(0) : swipeView.incrementCurrentIndex()
onRightButtonReleased: swipeView.currentIndex == (swipeView.count-1) ? swipeView.setCurrentIndex(0) : swipeView.incrementCurrentIndex()
onLeftButtonReleased: swipeView.decrementCurrentIndex()
}
......@@ -54,6 +54,11 @@ ApplicationWindow {
onNextPage: swipeView.incrementCurrentIndex()
}
PageAuthentication
{
id: pageAuthentication
}
PageChargeSelect
{
id: pageChargeSelect
......@@ -96,25 +101,33 @@ ApplicationWindow {
pagePayment.initializeValues();
infoPopup.setDescription( 0 )
break;
case 1: // PageChargeSelect
case 1: // PageAutentification
footerItem.leftButtonVisible = 1
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = 1
footerItem.leftButtonText = qsTr("Cancel")
footerItem.rightButtonText = qsTr("Confirm")
infoPopup.setDescription( 1 )
break;
case 2: // PageChargeSelect
footerItem.leftButtonVisible = 1
footerItem.leftButtonEnabled = 1
footerItem.leftButtonText = qsTr("Cancel")
footerItem.leftButtonText = qsTr("Back")
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = ( pageChargeSelect.dialValue > Variables.initialCharge );
footerItem.rightButtonText = qsTr("Confirm")
infoPopup.setDescription( 1 )
infoPopup.setDescription( 2 )
break;
case 2: // PagePayment
case 3: // PagePayment
footerItem.leftButtonVisible = 1
footerItem.leftButtonEnabled = 1
footerItem.leftButtonText = qsTr("Back")
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = 0
footerItem.rightButtonText = qsTr("Continue")
infoPopup.setDescription( 2 )
infoPopup.setDescription( 3 )
break;
case 3: // PageChargeConfirm
case 4: // PageChargeConfirm
footerItem.leftButtonVisible = 0
footerItem.leftButtonEnabled = 0
footerItem.rightButtonVisible = 1
......@@ -123,8 +136,8 @@ ApplicationWindow {
pageCharging.batteryInfo.topUpCharge = pageChargeSelect.dialValue
pageCharging.batteryInfo.chargingStarted = true;
pageCharging.batteryInfo.initialCharge = Variables.initialCharge
pageCharging.batteryInfo.initializeValues();
infoPopup.setDescription( 3 )
pageCharging.initializeValues();
infoPopup.setDescription( 4 )
break;
}
}
......
......@@ -48,5 +48,19 @@
<file>Assets/Background/EVCS_infobox_550x368.png</file>
<file>PopupMap.qml</file>
<file>Assets/Promo/Promo01.mp4</file>
<file>PageAuthentication.qml</file>
<file>AuthenticationTextInput.qml</file>
<file>Assets/Select/EVCS_dial_554x220_top.png</file>
<file>Assets/Fonts/TitilliumWeb-Black.ttf</file>
<file>Assets/Fonts/TitilliumWeb-Bold.ttf</file>
<file>Assets/Fonts/TitilliumWeb-BoldItalic.ttf</file>
<file>Assets/Fonts/TitilliumWeb-ExtraLight.ttf</file>
<file>Assets/Fonts/TitilliumWeb-ExtraLightItalic.ttf</file>
<file>Assets/Fonts/TitilliumWeb-Italic.ttf</file>
<file>Assets/Fonts/TitilliumWeb-Light.ttf</file>
<file>Assets/Fonts/TitilliumWeb-LightItalic.ttf</file>
<file>Assets/Fonts/TitilliumWeb-Regular.ttf</file>
<file>Assets/Fonts/TitilliumWeb-SemiBold.ttf</file>
<file>Assets/Fonts/TitilliumWeb-SemiBoldItalic.ttf</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment