even a bit nicer

This commit is contained in:
Aaron Seigo 2014-09-29 19:40:48 +02:00
parent e7bf696c28
commit bc8e7cfa59

View file

@ -44,16 +44,13 @@ Rectangle {
} }
onExpandedChanged: { onExpandedChanged: {
if (expanded) { if (expanded && body) {
height = units.gridUnit * 2;
summaryText.text = summary;
} else {
height = units.gridUnit * 4; height = units.gridUnit * 4;
if (body) { } else {
summaryText.text = summary + "\n" + body; height = units.gridUnit * 2;
}
} }
} }
MouseArea { MouseArea {
anchors.fill: root anchors.fill: root
drag.axis: Drag.XAxis drag.axis: Drag.XAxis
@ -129,10 +126,13 @@ Rectangle {
Text { Text {
id: summaryText id: summaryText
anchors.fill: parent anchors.fill: parent
clip: true
horizontalAlignment: Qt.AlignLeft horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
color: "white" color: "white"
text: summary text: summary + (root.expanded ? (body ? "\n" + body : '') :
} (body ? '...' : ''))
}
} }
} }