~aacid/unity8/unrevertr388

« back to all changes in this revision

Viewing changes to Components/Tile.qml

  • Committer: Albert Astals
  • Date: 2013-10-08 13:12:21 UTC
  • Revision ID: albert.astals@canonical.com-20131008131221-013jlfzdzoohvw6p
UnrevertĀ r388

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import Ubuntu.Components 0.1
19
19
 
20
20
AbstractButton {
21
 
    id: root
22
 
    property alias source: image.source
23
 
    property alias fillMode: image.fillMode
24
 
    property alias horizontalAlignment: image.horizontalAlignment
25
 
    property alias verticalAlignment: image.verticalAlignment
26
 
    property alias text: label.text
 
21
    property url source
 
22
    property int fillMode: Image.PreserveAspectCrop
 
23
    property int horizontalAlignment: Image.AlignHCenter
 
24
    property int verticalAlignment: Image.AlignVCenter
 
25
    property string text
27
26
    property int imageWidth
28
27
    property int imageHeight
29
 
 
30
 
    UbuntuShape {
31
 
        id: icon
32
 
        anchors {
33
 
            top: parent.top
34
 
            horizontalCenter: parent.horizontalCenter
35
 
        }
36
 
        radius: "medium"
37
 
        width: imageWidth
38
 
        height: imageHeight
39
 
        image: Image {
40
 
            id: image
41
 
            objectName: "image"
42
 
            sourceSize { width: icon.width; height: icon.height }
43
 
            asynchronous: true
44
 
            cache: false
45
 
        }
46
 
    }
47
 
 
48
 
    UbuntuShape {
49
 
        id: borderPressed
50
 
        objectName: "borderPressed"
51
 
 
52
 
        anchors.fill: icon
53
 
        radius: "medium"
54
 
        borderSource: "radius_pressed.sci"
55
 
        opacity: root.pressed ? 1.0 : 0.0
56
 
        Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
57
 
    }
58
 
 
59
 
    Item {
60
 
        anchors {
61
 
            left: parent.left
62
 
            right: parent.right
63
 
            top: icon.bottom
64
 
        }
65
 
        height: units.gu(2)
66
 
 
67
 
        Label {
68
 
            id: label
69
 
            objectName: "label"
70
 
            anchors {
71
 
                baseline: parent.bottom
72
 
                left: parent.left
73
 
                right: parent.right
74
 
                leftMargin: units.gu(1)
75
 
                rightMargin: units.gu(1)
76
 
            }
77
 
 
78
 
            color: Theme.palette.selected.backgroundText
79
 
            opacity: 0.9
80
 
            style: Text.Raised
81
 
            styleColor: "black"
82
 
            fontSize: "small"
83
 
            elide: Text.ElideMiddle
84
 
            horizontalAlignment: Text.AlignHCenter
85
 
        }
86
 
    }
 
28
    property int maximumLineCount: 1
 
29
 
 
30
    style: TileStyle {}
87
31
}