src/GUI/qml/ArrowButton.qml
raw| 1 | import QtQuick 2.4 |
| 2 | |
| 3 | Item { |
| 4 | id: root |
| 5 | signal clicked; |
| 6 | |
| 7 | |
| 8 | property alias arrow: img.source |
| 9 | |
| 10 | implicitWidth: img.width + 4 |
| 11 | implicitHeight: img.height + 4 |
| 12 | |
| 13 | Rectangle { |
| 14 | visible: mouse.containsMouse |
| 15 | radius: 3 |
| 16 | anchors.fill: parent |
| 17 | color: "#1b7ad3" |
| 18 | } |
| 19 | |
| 20 | Image { |
| 21 | id: img |
| 22 | anchors.centerIn: parent |
| 23 | } |
| 24 | |
| 25 | MouseArea { |
| 26 | id: mouse |
| 27 | anchors.fill: parent |
| 28 | hoverEnabled: true |
| 29 | |
| 30 | onClicked: { |
| 31 | root.clicked(); |
| 32 | } |
| 33 | } |
| 34 | } |