on fab9bd9 help sign in
73 lines 2.1 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.0
18import Ubuntu.Components 0.1
20Item {
21 /*!
22 \preliminary
23 The text that is shown as the header text.
24 \qmlproperty string text
25 */
26 property alias text: label.text
27 property alias textColor: label.color
28 property alias image: image.source
30 signal clicked(variant mouse)
32 height: units.gu(5)
34 Item {
35 anchors {
36 left: parent.left
37 right: parent.right
38 rightMargin: units.gu(0.5)
39 top: parent.top
40 bottom: parent.bottom
41 }
43 Label {
44 id: label
45 anchors {
46 left: parent.left
47 leftMargin: units.gu(2)
48 verticalCenter: parent.verticalCenter
49 }
51 color: "grey" // TODO karni: Update Ubuntu.Compoonents.Themes.Palette.
52 font.family: "Ubuntu"
53 fontSize: "medium"
54 elide: Text.ElideRight
55 textFormat: Text.PlainText
56 width: parent.width - image.width - image.leftMargin - anchors.leftMargin
57 }
59 Image {
60 id: image
61 readonly property double leftMargin: units.gu(1)
62 x: label.x + label.contentWidth + leftMargin
63 anchors {
64 verticalCenter: parent.verticalCenter
65 }
66 }
67 }
69 MouseArea {
70 anchors.fill: parent
71 onClicked: parent.clicked(mouse)
72 }