summaryrefslogtreecommitdiffstats
path: root/app/ContactsView.qml
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2018-05-22 11:33:10 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2018-05-22 11:33:10 +0000
commit361f599d0786b0b2729350a622c2a32a6a4862b5 (patch)
tree3337212cb405995d5247aa03197be298576e896a /app/ContactsView.qml
parent4555731ec96de6e2ff29105e3a50df51a8278d2a (diff)
parentb00822fe8b233f33adca86f93e5c1b90050983aa (diff)
Merge "contacts: handle multiple numbers and types"
Diffstat (limited to 'app/ContactsView.qml')
-rw-r--r--app/ContactsView.qml36
1 files changed, 27 insertions, 9 deletions
diff --git a/app/ContactsView.qml b/app/ContactsView.qml
index 2a00cf5..8d37590 100644
--- a/app/ContactsView.qml
+++ b/app/ContactsView.qml
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 The Qt Company Ltd.
+ * Copyright (C) 2018 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,14 +16,27 @@
*/
import QtQuick 2.6
-import QtQuick.Layouts 1.1
+import QtQuick.Layouts 1.3
import QtQuick.Controls 2.0
import AGL.Demo.Controls 1.0
+import NumberType 1.0
import 'models'
Item {
id: root
+ function display_type(type) {
+ if (type == NumberType.Mobile) {
+ return "M"
+ } else if (type == NumberType.Work) {
+ return "W"
+ } else if (type == NumberType.Home) {
+ return "H"
+ } else {
+ return "O"
+ }
+ }
+
signal call(var contact)
signal cancel
@@ -47,11 +61,11 @@ Item {
model: ContactsModel {}
delegate: MouseArea {
width: ListView.view.width
- height: width / 5
+ height: width / 3
RowLayout {
anchors.fill: parent
anchors.leftMargin: 200
- spacing: 20
+ spacing: 100
Image {
source: './images/HMI_ContactScreen_ImageHolder-01.svg'
}
@@ -59,14 +73,18 @@ Item {
Label {
Layout.fillWidth: true
color: '#59FF7F'
- text: model.name
+ font.pixelSize: 50
+ text: name
}
- Label {
- Layout.fillWidth: true
- font.pixelSize: 30
- text: model.number
- }
+ Repeater {
+ model: numbers
+ delegate: Label {
+ Layout.fillWidth: true
+ font.pixelSize: 50
+ text: display_type(type) + ": " + number
+ }
+ }
}
}
onClicked: {