on xenial help sign in
Different approach
3eb774eAndrea Cimitan
qml/Dash/Previews/PreviewTextSummary.qml+4−7
@@ -28,12 +28,7 @@ import "../../Components"
28
28
29PreviewWidget {
29PreviewWidget {
30 id: root
30 id: root
31− implicitHeight: {
31+ implicitHeight: childrenRect.height
32− var tmpHeight = textLabel.height;
33− if (titleLabel.visible) tmpHeight += titleLabel.height;
34− if (seeMore.visible) tmpHeight += seeMore.height + seeMore.anchors.topMargin;
35− return tmpHeight;
36− }
37
32
38 Label {
33 Label {
39 id: titleLabel
34 id: titleLabel
@@ -42,6 +37,7 @@ PreviewWidget {
42 left: parent.left
37 left: parent.left
43 right: parent.right
38 right: parent.right
44 }
39 }
40+ height: visible ? implicitHeight : 0
45 fontSize: "large"
41 fontSize: "large"
46 // TODO karni: Yet another fix requiring Palette update.
42 // TODO karni: Yet another fix requiring Palette update.
47 color: "grey" //Theme.palette.selected.backgroundText
43 color: "grey" //Theme.palette.selected.backgroundText
@@ -84,8 +80,9 @@ PreviewWidget {
84 left: parent.left
80 left: parent.left
85 right: parent.right
81 right: parent.right
86 top: textLabel.bottom
82 top: textLabel.bottom
87− topMargin: units.gu(1)
83+ topMargin: visible ? units.gu(1) : 0
88 }
84 }
85+ height: visible ? implicitHeight : 0
89 visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
86 visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
90 }
87 }
91}
88}