FlickPagerArrow.qml 781 B

12345678910111213141516171819202122232425262728293031323334
  1. import QtQuick 2.0
  2. Rectangle {
  3. id: arrow
  4. property string source: icon.source
  5. property bool active: false
  6. signal clicked()
  7. anchors.right: parent.right
  8. anchors.left: parent.left
  9. height: 27
  10. Image {
  11. id: icon
  12. Behavior on opacity {
  13. NumberAnimation {
  14. duration: 200
  15. }
  16. }
  17. visible: opacity > 0.0
  18. opacity: active ? 1.0 : 0.0
  19. anchors.centerIn: parent
  20. source: control.pressed ? "qrc:///images/" + arrow.source + "_active.png" : "qrc:///images/" + arrow.source + ".png"
  21. }
  22. MouseArea {
  23. id: control
  24. anchors.fill: parent
  25. hoverEnabled: true
  26. enabled: arrow.active
  27. onClicked: {
  28. arrow.clicked()
  29. }
  30. }
  31. }