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

Item {
    property alias image: icon.source
    property variant action

    width: 40; height: parent.height

    Image {
        id: icon; anchors.centerIn: parent
        opacity: action.enabled ? 1.0 : 0.4
    }

    MouseArea {
        anchors { fill: parent; topMargin: -10; bottomMargin: -10 }
        onClicked: action.trigger()
    }
}