Dekko
Loading...
Searching...
No Matches
RecipientInfo.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import QtQuick.Controls.Suru 2.2
20import Lomiri.Components 1.3
21import Lomiri.Components.Popups 1.3
22import Dekko.Components 1.0
23import Dekko.Lomiri.Components 1.0
25DetailItem {
26 property var address
27 internalHeight: col.height
28 height: parent.height
29 width: parent.width
30 color: Suru.secondaryBackgroundColor
31 Column {
32 id: col
33 anchors {
34 left: parent.left
35 top: parent.top
36 right: parent.right
37 }
38 ListItem {
39 height: l.height
40 ListItemLayout {
41 id: l
42 title.text: qsTr("Back")
43 Icon {
44 name: "back"
45 height: units.gu(2.5); width: height
46 SlotsLayout.position: SlotsLayout.Leading
47 }
48 }
49 onClicked: detailStack.pop()
50 }
51
52 ListItem {
53 height: layout.height
54 PixelPerfectItem {
55 anchors.fill: parent
56 ListItemLayout {
57 id: layout
58 title.text: address ? address.name : model.email
59 title.elide: Text.ElideRight
60 title.wrapMode: Text.NoWrap
61 subtitle.text: {
62 if (address.name) {
63 if (address.name !== address.address)
64 return address.address
65 else
66 return ""
67 }/* else if (model.isInContacts) {
68 return model.contactInfo.organization
69 } else {
70 return ""
71 }*/
72 }
73 // summary.text: address.name && model.isInContacts ? model.contactInfo.organization : ""
74 subtitle.elide: Text.ElideRight
75 subtitle.wrapMode: Text.NoWrap
76
77 Avatar {
78 id: avatar
79 name: address.name
80 initials: address.initials
81 email: address.address
82 validContact: true
83 fontSize: "large"
84 SlotsLayout.position: SlotsLayout.Leading
85 }
86 }
87 }
88 }
89 }
90}