@@ -28,64 +28,59 @@ import "../../Components"
2828
2929PreviewWidget {
3030 id: root
31− implicitHeight: column.height
31+ implicitHeight: seeMore.visible ? childrenRect.height : titleLabel.height + textLabel.height
3232
33− Column {
34− id: column
35− anchors { left: parent.left; right: parent.right; }
36−
37− Label {
38− id: titleLabel
39− objectName: "titleLabel"
40− anchors { left: parent.left; right: parent.right }
41− fontSize: "large"
42− // TODO karni: Yet another fix requiring Palette update.
43− color: "grey" //Theme.palette.selected.backgroundText
44− visible: text !== ""
45− opacity: .8
46− text: widgetData["title"] || ""
47− wrapMode: Text.Wrap
33+ Label {
34+ id: titleLabel
35+ objectName: "titleLabel"
36+ anchors {
37+ left: parent.left
38+ right: parent.right
4839 }
40+ fontSize: "large"
41+ // TODO karni: Yet another fix requiring Palette update.
42+ color: "grey" //Theme.palette.selected.backgroundText
43+ visible: text !== ""
44+ opacity: .8
45+ text: widgetData["title"] || ""
46+ wrapMode: Text.Wrap
47+ }
4948
50− Label {
51− id: textLabel
52− objectName: "textLabel"
53−
54− readonly property int maximumCollapsedLineCount: 7
49+ Label {
50+ id: textLabel
51+ objectName: "textLabel"
5552
56− anchors { left: parent.left; right: parent.right }
57− height: (!seeMoreContainer.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
58− clip: true
59− fontSize: "small"
60− lineHeight: 1.2
61− // TODO karni: Yet another fix requiring Palette update.
62− color: "grey" //Theme.palette.selected.backgroundText
63− opacity: .8
64− text: widgetData["text"]
65− wrapMode: Text.Wrap
53+ readonly property int maximumCollapsedLineCount: 7
6654
67− Behavior on height {
68− UbuntuNumberAnimation {}
69− }
55+ anchors {
56+ left: parent.left
57+ right: parent.right
58+ top: titleLabel.visible ? titleLabel.bottom : parent.top
7059 }
60+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
61+ clip: true
62+ fontSize: "small"
63+ lineHeight: 1.2
64+ // TODO karni: Yet another fix requiring Palette update.
65+ color: "grey" //Theme.palette.selected.backgroundText
66+ opacity: .8
67+ text: widgetData["text"]
68+ wrapMode: Text.Wrap
7169
72− Item {
73− id: seeMoreContainer
74− objectName: "seeMoreContainer"
75− anchors { left: parent.left; right: parent.right }
76− height: seeMore.height
77− visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
70+ Behavior on height {
71+ UbuntuNumberAnimation {}
72+ }
73+ }
7874
79− SeeMore {
80− id: seeMore
81− objectName: "seeMore"
82− anchors {
83− left: parent.left
84− right: parent.right
85− top: parent.top
86− topMargin: units.gu(1)
87− }
88− }
75+ SeeMore {
76+ id: seeMore
77+ objectName: "seeMore"
78+ anchors {
79+ left: parent.left
80+ right: parent.right
81+ top: textLabel.bottom
82+ topMargin: units.gu(1)
8983 }
84+ visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
9085 }
9186}