~unity-team/+junk/dashboard-playground

« back to all changes in this revision

Viewing changes to Components/ListItems/Header.qml

  • Committer: Michał Sawicz
  • Date: 2013-06-05 22:03:08 UTC
  • Revision ID: michal.sawicz@canonical.com-20130605220308-yny8fv3futtr04fg
Inital unity8 commit.

Previous history can be found at https://code.launchpad.net/~unity-team/unity/phablet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
16
 
 
17
import QtQuick 2.0
 
18
import Ubuntu.Components 0.1
 
19
 
 
20
Item {
 
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
 
 
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
 
33
 
 
34
    height: units.gu(4.5)
 
35
 
 
36
    Item {
 
37
        anchors {
 
38
            left: parent.left
 
39
            right: parent.right
 
40
            top: parent.top
 
41
            bottom: bottomBorder.top
 
42
        }
 
43
 
 
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
            }
 
53
 
 
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
    }
 
64
 
 
65
    ThinDivider {
 
66
        id: bottomBorder
 
67
        anchors {
 
68
            left: parent.left
 
69
            right: parent.right
 
70
            bottom: parent.bottom
 
71
        }
 
72
    }
 
73
}