on xenial help sign in
using column
commitec6ec10461df93c18a7b4119ecabcf220897d7ec authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 1 May 2014, 12:01 (13 years ago) parent22c8e52
1 file changed+49−42
qml/Dash/Previews/PreviewTextSummary.qml+49−42
qml/Dash/Previews/PreviewTextSummary.qml+49−42
@@ -28,59 +28,66 @@ import "../../Components"
2828
2929PreviewWidget {
3030 id: root
31− implicitHeight: seeMore.visible ? childrenRect.height : childrenRect.height - seeMore.height - seeMore.anchors.topMargin
31+ implicitHeight: column.height
3232
33− Label {
34− id: titleLabel
35− objectName: "titleLabel"
33+ Column {
34+ id: column
3635 anchors {
3736 left: parent.left
3837 right: parent.right
3938 }
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− }
48−
49− Label {
50− id: textLabel
51− objectName: "textLabel"
5239
53− readonly property int maximumCollapsedLineCount: 7
40+ Label {
41+ id: titleLabel
42+ objectName: "titleLabel"
5443
55− anchors {
56− left: parent.left
57− right: parent.right
58− top: titleLabel.visible ? titleLabel.bottom : parent.top
44+ anchors {
45+ left: parent.left
46+ right: parent.right
47+ }
48+ fontSize: "large"
49+ // TODO karni: Yet another fix requiring Palette update.
50+ color: "grey" //Theme.palette.selected.backgroundText
51+ visible: text !== ""
52+ opacity: .8
53+ text: widgetData["title"] || ""
54+ wrapMode: Text.Wrap
5955 }
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
6956
70− Behavior on height {
71− UbuntuNumberAnimation {}
57+ Label {
58+ id: textLabel
59+ objectName: "textLabel"
60+
61+ readonly property int maximumCollapsedLineCount: 7
62+
63+ anchors {
64+ left: parent.left
65+ right: parent.right
66+ }
67+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
68+ clip: true
69+ fontSize: "small"
70+ lineHeight: 1.2
71+ // TODO karni: Yet another fix requiring Palette update.
72+ color: "grey" //Theme.palette.selected.backgroundText
73+ opacity: .8
74+ text: widgetData["text"]
75+ wrapMode: Text.Wrap
76+
77+ Behavior on height {
78+ UbuntuNumberAnimation {}
79+ }
7280 }
73− }
7481
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)
82+ SeeMore {
83+ id: seeMore
84+ objectName: "seeMore"
85+ anchors {
86+ left: parent.left
87+ right: parent.right
88+ topMargin: units.gu(1)
89+ }
90+ visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
8391 }
84− visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
8592 }
8693}