CommitInfo.qml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. ]
  22. transitions: Transition {
  23. NumberAnimation {
  24. properties: "height"
  25. duration: 200
  26. }
  27. }
  28. Column {
  29. id: shortInfo
  30. anchors.top: parent.top
  31. width: parent.width
  32. CommitInfoLine {
  33. field: qsTr("Time")
  34. value: commit ? commit.time : ""
  35. }
  36. CommitInfoLine {
  37. field: qsTr("Author")
  38. value: commit ? commit.author : ""
  39. }
  40. CommitInfoLine {
  41. field: qsTr("Email")
  42. value: commit ? commit.email : ""
  43. }
  44. }
  45. Column {
  46. anchors.top: shortInfo.bottom
  47. width: parent.width
  48. Text {
  49. wrapMode: Text.WordWrap
  50. width: contentWidth
  51. height: contentHeight
  52. text: qsTr("Message") + ": "
  53. font.pointSize: 10
  54. font.weight: Font.Bold
  55. }
  56. Rectangle {
  57. width: 10
  58. height: 10
  59. }
  60. Text {
  61. id: content
  62. wrapMode: Text.WordWrap
  63. width: parent.width
  64. height: contentHeight
  65. text: commit ? commit.message : ""
  66. }
  67. Rectangle {
  68. anchors.horizontalCenter: parent.horizontalCenter
  69. width: parent.width - 4
  70. height: 2
  71. radius: 2
  72. color: "#eeeeee"
  73. }
  74. Rectangle {
  75. width: 10
  76. height: 10
  77. }
  78. }
  79. }