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

« back to all changes in this revision

Viewing changes to places/Section.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
AbstractButton {
 
4
    property alias label: label.text
 
5
    property int horizontalPadding: 0
 
6
    property int verticalPadding: 0
 
7
    property bool isActiveSection: false
 
8
    property bool activeOrPressed: isActiveSection || state == "pressed"
 
9
 
 
10
    width: label.width + horizontalPadding*2
 
11
    height: label.height + verticalPadding*2
 
12
 
 
13
    Rectangle {
 
14
        anchors.fill: parent
 
15
        opacity: activeOrPressed || parent.state == "selected" ? 1.0 : 0.0
 
16
 
 
17
        color: activeOrPressed ? "#ffffffff" : "#00000000"
 
18
        border.color: "#cccccc"
 
19
        border.width: 1
 
20
        radius: 3
 
21
 
 
22
        Behavior on opacity {NumberAnimation {duration: 100}}
 
23
 
 
24
        Image {
 
25
            fillMode: Image.Tile
 
26
            anchors.fill: parent
 
27
            source: "artwork/button_background.png"
 
28
            smooth: false
 
29
        }
 
30
    }
 
31
 
 
32
    TextCustom {
 
33
        id: label
 
34
 
 
35
        width: paintedWidth
 
36
        height: paintedHeight
 
37
        anchors.verticalCenter: parent.verticalCenter
 
38
        anchors.horizontalCenter: parent.horizontalCenter
 
39
 
 
40
        color: activeOrPressed ? "#444444" : "#ffffff"
 
41
        horizontalAlignment: Text.AlignHCenter
 
42
    }
 
43
}