summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/Button.qml
blob: c7a49f197e73bfb3cf4b6e6ba51d44925c972d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import Qt 4.6

Rect { 
    id: page; color: activePalette.button; width: txtItem.width+20; height: txtItem.height+4
    border.width: 1; border.color: activePalette.mid; radius: 10;
    signal clicked
    property string text: "Button"
    gradient: Gradient { 
        GradientStop { id:topGrad; position: 0.0; 
            color: if(mr.pressed){activePalette.dark;}else{activePalette.light;}}
        GradientStop { position: 1.0; color: activePalette.button }
    }
    MouseRegion { id:mr; anchors.fill: parent; onClicked: page.clicked() }
    Text {
        id: txtItem; text: page.text; anchors.centerIn: page; color: activePalette.buttonText 
        font.size: 14;
    }
}