summaryrefslogtreecommitdiffstats
path: root/src/gui/qml/ImageButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/qml/ImageButton.qml')
-rw-r--r--src/gui/qml/ImageButton.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/qml/ImageButton.qml b/src/gui/qml/ImageButton.qml
new file mode 100644
index 0000000..3d76fa7
--- /dev/null
+++ b/src/gui/qml/ImageButton.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.1
+
+Rectangle {
+
+ property alias image: img.source
+ signal clicked
+
+ color: "transparent"
+ z: 2
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+
+ Image {
+ id: img
+ smooth: true
+ anchors.fill: parent
+ }
+
+ states: State {
+ name: "pressed"; when: mouseArea.pressed
+ PropertyChanges { target: img; anchors.topMargin: 2; anchors.bottomMargin: -2 }
+ }
+}
+