~ubuntu-branches/ubuntu/natty/unity-2d/natty-updates

« back to all changes in this revision

Viewing changes to places/GroupHeader.qml

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2011-01-14 17:42:08 UTC
  • Revision ID: james.westby@ubuntu.com-20110114174208-ww045t7shnu3a5zv
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import Qt 4.7
 
2
 
 
3
Button {
 
4
    property alias icon: icon.source
 
5
    property alias label: label.text
 
6
    property bool folded: true
 
7
    property int availableCount
 
8
 
 
9
 
 
10
    Image {
 
11
        id: icon
 
12
 
 
13
        width: 22
 
14
        height: 22
 
15
        anchors.verticalCenter: parent.verticalCenter
 
16
        anchors.left: parent.left
 
17
        anchors.leftMargin: 7
 
18
        fillMode: Image.PreserveAspectFit
 
19
        sourceSize.width: width
 
20
        sourceSize.height: height
 
21
    }
 
22
 
 
23
    TextCustom {
 
24
        id: label
 
25
 
 
26
        color: parent.state == "pressed" ? "#444444" : "#ffffff"
 
27
        font.pixelSize: 16
 
28
        anchors.bottom: parent.bottom
 
29
        anchors.bottomMargin: 5
 
30
        anchors.left: icon.right
 
31
        anchors.leftMargin: 5
 
32
        width: paintedWidth
 
33
    }
 
34
 
 
35
    Image {
 
36
        id: arrow
 
37
 
 
38
        visible: availableCount > 0
 
39
        rotation: folded ? 0 : 90
 
40
        source: "artwork/arrow.png"
 
41
        width: 7
 
42
        height: 7
 
43
        anchors.verticalCenter: parent.verticalCenter
 
44
        anchors.left: label.right
 
45
        anchors.leftMargin: 6
 
46
        fillMode: Image.PreserveAspectFit
 
47
        sourceSize.width: width
 
48
        sourceSize.height: height
 
49
    }
 
50
 
 
51
    Rectangle {
 
52
        id: underline
 
53
 
 
54
        opacity: parent.state == "selected" ? 0.0 : 1.0
 
55
        Behavior on opacity {NumberAnimation {duration: 100}}
 
56
 
 
57
        height: 1
 
58
        anchors.bottom: parent.bottom
 
59
        anchors.left: parent.left
 
60
        anchors.leftMargin: 5
 
61
        anchors.right: parent.right
 
62
        anchors.rightMargin: 1
 
63
 
 
64
        color: "#4cffffff"
 
65
    }
 
66
}