Debian Codegraph @

src/imports/Lomiri/Contacts/SubtitledWithColors.qml

raw
1 /*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 import QtQuick 2.4
18 import Lomiri.Components 1.3
19
20 MouseArea {
21 id: subtitledListItem
22
23 property alias text: label.text
24 property alias subText: subLabel.text
25 property alias textColor: label.color
26 property alias subTextColor: subLabel.color
27
28 height: Math.max(middleVisuals.height, units.gu(6))
29 Item {
30 id: middleVisuals
31 anchors {
32 left: parent.left
33 leftMargin: units.gu(2)
34 right: parent.right
35 verticalCenter: parent.verticalCenter
36 }
37 height: childrenRect.height + label.anchors.topMargin + subLabel.anchors.bottomMargin
38
39 Label {
40 id: label
41 anchors {
42 top: parent.top
43 left: parent.left
44 right: parent.right
45 }
46 }
47 Label {
48 id: subLabel
49 anchors {
50 left: parent.left
51 right: parent.right
52 top: label.bottom
53 }
54 fontSize: "small"
55 wrapMode: Text.Wrap
56 maximumLineCount: 5
57 }
58 }
59 }