on 8e7fd7e help sign in
73 lines 2.2 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
28 /* When this header is used in a ListViewWithPageHeader with CurrentLabelAtStart mode, to stop
29 the list's delegates contents being visible through this header, they clip themselves
30 depending on their position. However to allow delegates underlap the bottom X pixels of this
31 header (so delegate appears through ThinDivider say) we set an offset property here. */
32 readonly property int bottomBorderAllowedOverlap: bottomBorder.allowedBottomOverlap
34 height: units.gu(4.5)
36 Item {
37 anchors {
38 left: parent.left
39 right: parent.right
40 top: parent.top
41 bottom: bottomBorder.top
42 }
44 Label {
45 id: label
46 anchors {
47 left: parent.left
48 leftMargin: units.gu(2)
49 right: parent.right
50 rightMargin: units.gu(0.5)
51 verticalCenter: parent.verticalCenter
52 }
54 color: "#f3f3e7" //at 60%
55 opacity: 0.6
56 font.family: "Ubuntu"
57 fontSize: "medium"
58 elide: Text.ElideRight
59 textFormat: Text.PlainText
60 style: Text.Raised
61 styleColor: "black"
62 }
63 }
65 ThinDivider {
66 id: bottomBorder
67 anchors {
68 left: parent.left
69 right: parent.right
70 bottom: parent.bottom
71 }
72 }