FloatingRoundButton.qml 495 B

12345678910111213141516171819202122
  1. import QtQuick 2.0
  2. Rectangle {
  3. id: root
  4. width: 70
  5. property color primaryColor: "#03A9F4"
  6. property color secondaryColor: "#2196F3"
  7. height: width
  8. radius: width/2
  9. signal clicked()
  10. property alias icon: iconItem.source
  11. color: control.pressed ? root.secondaryColor : root.primaryColor
  12. Image {
  13. anchors.centerIn: parent
  14. id: iconItem
  15. }
  16. MouseArea {
  17. id: control
  18. anchors.fill: parent
  19. onClicked: root.clicked()
  20. }
  21. }