on xenial help sign in
More work on column
commitbeea01ef8c33df35a851cd4f612e17c7bff6fa3c authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 1 May 2014, 13:59 (13 years ago) parent2292432
2 files changed+22−20
qml/Dash/Previews/PreviewTextSummary.qml+20−20 tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+2
qml/Dash/Previews/PreviewTextSummary.qml+20−20
@@ -32,18 +32,12 @@ PreviewWidget {
3232
3333 Column {
3434 id: column
35− anchors {
36− left: parent.left
37− right: parent.right
38− }
35+ anchors { left: parent.left; right: parent.right; }
3936
4037 Label {
4138 id: titleLabel
4239 objectName: "titleLabel"
43− anchors {
44− left: parent.left
45− right: parent.right
46− }
40+ anchors { left: parent.left; right: parent.right }
4741 fontSize: "large"
4842 // TODO karni: Yet another fix requiring Palette update.
4943 color: "grey" //Theme.palette.selected.backgroundText
@@ -59,11 +53,8 @@ PreviewWidget {
5953
6054 readonly property int maximumCollapsedLineCount: 7
6155
62− anchors {
63− left: parent.left
64− right: parent.right
65− }
66− height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2) + units.gu(1)
56+ anchors { left: parent.left; right: parent.right }
57+ height: (!seeMoreContainer.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
6758 clip: true
6859 fontSize: "small"
6960 lineHeight: 1.2
@@ -78,14 +69,23 @@ PreviewWidget {
7869 }
7970 }
8071
81− SeeMore {
82− id: seeMore
83− objectName: "seeMore"
84− anchors {
85− left: parent.left
86− right: parent.right
87− }
72+ Item {
73+ id: seeMoreContainer
74+ objectName: "seeMoreContainer"
75+ anchors { left: parent.left; right: parent.right }
76+ height: seeMore.height
8877 visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
78+
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+ }
8989 }
9090 }
9191}
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+2
@@ -75,6 +75,7 @@ Rectangle {
7575
7676 function test_see_more() {
7777 var seeMore = findChild(previewTextSummary, "seeMore")
78+ var seeMoreContainer = findChild(previewTextSummary, "seeMoreContainer")
7879
7980 // when it's more than textLabel.maximumCollapsedLineCount lines of text, show SeeMore component
8081 verify(textLabel.lineCount > textLabel.maximumCollapsedLineCount)
@@ -94,6 +95,7 @@ Rectangle {
9495 // text SeeMore automatic hiding
9596 previewTextSummary.widgetData = widgetDataShortText
9697 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
98+ compare(seeMoreContainer.visible, false)
9799 compare(seeMore.visible, false)
98100 tryCompare(textLabel, "height", textLabel.contentHeight)
99101 }