PlayerTrackIcon.qml 555 B

12345678910111213141516171819202122232425262728293031
  1. import QtQuick 2.0
  2. import "components"
  3. Item {
  4. id: root
  5. width: 50
  6. height: 50
  7. property url src: ""
  8. RoundedImage {
  9. id: _icon
  10. source: src
  11. anchors.fill: root
  12. sourceSize.width: root.width
  13. sourceSize.height: root.height
  14. fillMode: Image.PreserveAspectCrop
  15. clip: true
  16. radius: 8
  17. }
  18. MouseArea {
  19. anchors.fill: _icon
  20. enabled: (src.toString().length > 0) && (src.toString().slice(0, 4) !== "qrc:")
  21. cursorShape: enabled? Qt.PointingHandCursor : Qt.ArrowCursor
  22. onClicked: Qt.openUrlExternally(src)
  23. }
  24. }