DiffFiles.qml 835 B

1234567891011121314151617181920212223242526272829303132
  1. import QtQuick 2.0
  2. ListView {
  3. id: root
  4. property var files: null
  5. signal openDiff(var file)
  6. spacing: 10
  7. model: files ? files : 0
  8. clip: true
  9. delegate: Item {
  10. width: commitBodyText.width
  11. height: commitBodyText.height + 10
  12. Text {
  13. id: commitBodyText
  14. anchors.bottom: parent.bottom
  15. font.pointSize: 10
  16. width: root.width
  17. text: modelData
  18. elide: Text.ElideLeft
  19. horizontalAlignment: Text.AlignRight
  20. color:control.containsMouse ? "#aaaaaa" : "#000000"
  21. MouseArea {
  22. id: control
  23. anchors.fill: parent
  24. hoverEnabled: true
  25. onClicked: {
  26. root.openDiff(modelData)
  27. }
  28. }
  29. }
  30. }
  31. }