qtmobility/examples/servicenotesmanager/declarative-sfw-notes/Button.qml
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 13:18:40 +0300
changeset 4 90517678cc4f
permissions -rw-r--r--
Revision: 201015 Kit: 201018

import Qt 4.6

Rectangle {
    id: container

    signal clicked
    property string image: ""
    property string text: ""

    color: activePalette.button; smooth: true
    border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8;

    gradient: Gradient {
        GradientStop {
            id: topGrad; position: 0.0
            color :if (mr.pressed) { activePalette.dark } else { activePalette.light } }
        GradientStop { position: 1.0; color: activePalette.button }
    }

    Image {
        id: imgItem;
        smooth: true
        width: 16; height: 16;
        source: container.image; anchors.centerIn: container
    }

    MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }

    Text {
        id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
    }
}