diff options
Diffstat (limited to 'demos/declarative/webbrowser/content/Button.qml')
-rw-r--r-- | demos/declarative/webbrowser/content/Button.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/demos/declarative/webbrowser/content/Button.qml b/demos/declarative/webbrowser/content/Button.qml new file mode 100644 index 0000000..a1baf16 --- /dev/null +++ b/demos/declarative/webbrowser/content/Button.qml @@ -0,0 +1,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() + } +} |