qtmobility/examples/servicenotesmanager/declarative-sfw-notes/Button.qml
changeset 4 90517678cc4f
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
       
     1 import Qt 4.6
       
     2 
       
     3 Rectangle {
       
     4     id: container
       
     5 
       
     6     signal clicked
       
     7     property string image: ""
       
     8     property string text: ""
       
     9 
       
    10     color: activePalette.button; smooth: true
       
    11     border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8;
       
    12 
       
    13     gradient: Gradient {
       
    14         GradientStop {
       
    15             id: topGrad; position: 0.0
       
    16             color :if (mr.pressed) { activePalette.dark } else { activePalette.light } }
       
    17         GradientStop { position: 1.0; color: activePalette.button }
       
    18     }
       
    19 
       
    20     Image {
       
    21         id: imgItem;
       
    22         smooth: true
       
    23         width: 16; height: 16;
       
    24         source: container.image; anchors.centerIn: container
       
    25     }
       
    26 
       
    27     MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
       
    28 
       
    29     Text {
       
    30         id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
       
    31     }
       
    32 }