123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import QtQuick 2.0
- Item {
- id: root
- property QtObject model: null
- state: "closed"
- clip: true
- states: [
- State {
- name: "opened"
- PropertyChanges {
- target: root
- height: childrenRect.height
- }
- },
- State {
- name: "closed"
- PropertyChanges {
- target: root
- height: shortInfo.height
- }
- },
- State {
- name: "hidden"
- when: !root.visible || model == null
- PropertyChanges {
- target: root
- height: 0
- }
- }
- ]
- onModelChanged:{
- if(model != null) {
- root.state = "closed"
- }
- }
- transitions: Transition {
- NumberAnimation {
- properties: "height"
- duration: 200
- }
- }
- Column {
- id: shortInfo
- anchors.top: parent.top
- width: parent.width
- CommitInfoLine {
- field: qsTr("Time")
- value: model ? model.time : ""
- }
- CommitInfoLine {
- field: qsTr("Author")
- value: model ? model.author : ""
- }
- CommitInfoLine {
- field: qsTr("Email")
- value: model ? model.email : ""
- }
- CommitInfoLine {
- field: qsTr("Summary")
- value: model ? model.summary : ""
- }
- }
- Image {
- id: merge
- visible: model ? model.isMerge : false
- source: "qrc:///images/flow-merge.png"
- anchors.right: shortInfo.right
- anchors.rightMargin: 5
- anchors.top: shortInfo.top
- }
- Column {
- anchors.top: shortInfo.bottom
- width: parent.width
- Text {
- wrapMode: Text.WordWrap
- width: contentWidth
- height: contentHeight
- text: qsTr("Message") + ": "
- font.pointSize: 10
- font.weight: Font.Bold
- }
- Rectangle {
- width: 10
- height: 10
- }
- Text {
- id: content
- wrapMode: Text.WordWrap
- width: parent.width
- height: contentHeight
- text: model ? model.message : ""
- }
- Rectangle {
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width - 4
- height: 2
- radius: 2
- color: "#eeeeee"
- }
- Rectangle {
- width: 10
- height: 10
- }
- }
- }
|