CommitInfo.qml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import QtQuick 2.0
  2. Item {
  3. id: root
  4. state: "closed"
  5. clip: true
  6. states: [
  7. State {
  8. name: "opened"
  9. PropertyChanges {
  10. target: root
  11. height: childrenRect.height
  12. }
  13. },
  14. State {
  15. name: "closed"
  16. PropertyChanges {
  17. target: root
  18. height: shortInfo.height
  19. }
  20. },
  21. State {
  22. name: "hidden"
  23. when: !root.visible
  24. PropertyChanges {
  25. target: root
  26. height: 0
  27. }
  28. }
  29. ]
  30. transitions: Transition {
  31. NumberAnimation {
  32. properties: "height"
  33. duration: 200
  34. }
  35. }
  36. Column {
  37. id: shortInfo
  38. anchors.top: parent.top
  39. width: parent.width
  40. CommitInfoLine {
  41. field: qsTr("Time")
  42. value: commit ? commit.time : ""
  43. }
  44. CommitInfoLine {
  45. field: qsTr("Author")
  46. value: commit ? commit.author : ""
  47. }
  48. CommitInfoLine {
  49. field: qsTr("Email")
  50. value: commit ? commit.email : ""
  51. }
  52. CommitInfoLine {
  53. field: qsTr("Summary")
  54. value: commit ? commit.summary : ""
  55. }
  56. }
  57. Image {
  58. id: merge
  59. visible: commit ? commit.isMerge : false
  60. source: "qrc:///images/flow-merge.png"
  61. anchors.right: shortInfo.right
  62. anchors.rightMargin: 5
  63. anchors.top: shortInfo.top
  64. }
  65. Column {
  66. anchors.top: shortInfo.bottom
  67. width: parent.width
  68. Text {
  69. wrapMode: Text.WordWrap
  70. width: contentWidth
  71. height: contentHeight
  72. text: qsTr("Message") + ": "
  73. font.pointSize: 10
  74. font.weight: Font.Bold
  75. }
  76. Rectangle {
  77. width: 10
  78. height: 10
  79. }
  80. Text {
  81. id: content
  82. wrapMode: Text.WordWrap
  83. width: parent.width
  84. height: contentHeight
  85. text: commit ? commit.message : ""
  86. }
  87. Rectangle {
  88. anchors.horizontalCenter: parent.horizontalCenter
  89. width: parent.width - 4
  90. height: 2
  91. radius: 2
  92. color: "#eeeeee"
  93. }
  94. Rectangle {
  95. width: 10
  96. height: 10
  97. }
  98. }
  99. }