on xenial help sign in
Changes according to review
commitfd362a4e554dd0c44c5f1a3613a4f371040b2e03 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateTue 4 Feb 2014, 17:52 (13 years ago) parent7ef4934
2 files changed+16−21
qml/Components/SeeMore.qml+6−13 tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+10−8
qml/Components/SeeMore.qml+6−13
@@ -43,20 +43,13 @@ Item {
4343 }
4444 }
4545
46− Row {
47− height: parent.height
48−
49− Rectangle {
50− width: units.dp(1)
51− height: parent.height
52− opacity: 0.2
53− color: Theme.palette.selected.backgroundText
54− }
55− Rectangle {
56− width: units.dp(1)
57− height: parent.height
58− color: Qt.rgba(1.0, 1.0, 1.0, 0.1)
46+ Image {
47+ anchors {
48+ top: parent.top
49+ bottom: parent.bottom
5950 }
51+ width: units.dp(2)
52+ source: "ListItems/graphics/ListItemDividerVertical.png"
6053 }
6154
6255 Label {
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+10−8
@@ -52,17 +52,24 @@ Rectangle {
5252
5353 property var textLabel: findChild(previewTextSummary, "textLabel")
5454
55− function test_optional_title() {
56− var titleLabel = findChild(previewTextSummary, "titleLabel")
55+ function init() {
56+ verify(typeof textLabel === "object", "TextLabel object could not be found.")
57+ }
5758
59+ function cleanup() {
5860 previewTextSummary.widgetData = widgetDataComplete
61+ }
62+
63+ function test_optional_title() {
64+ var titleLabel = findChild(previewTextSummary, "titleLabel")
5965
66+ // verify titleLabel is visible and textLabel is anchored below it
6067 compare(titleLabel.visible, true)
6168 var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
6269 compare(mappedTextLabel.y, titleLabel.height)
6370
71+ // verify titleLabel disappears and textLabel moves up
6472 previewTextSummary.widgetData = widgetDataNoTitle
65−
6673 compare(titleLabel.visible, false)
6774 verify(mappedTextLabel.y, 0)
6875 }
@@ -70,8 +77,6 @@ Rectangle {
7077 function test_see_more() {
7178 var seeMore = findChild(previewTextSummary, "seeMore")
7279
73− previewTextSummary.widgetData = widgetDataComplete
74−
7580 // when it's more than 7 lines of text, show SeeMore component
7681 verify(textLabel.lineCount > 7)
7782 compare(seeMore.visible, true)
@@ -82,16 +87,13 @@ Rectangle {
8287 var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
8388 var seeLessLabel = findChild(seeMore, "seeLessLabel")
8489 var initialTextLabelHeight = textLabel.height
85−
8690 mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
8791 tryCompare(textLabel, "height", textLabel.contentHeight)
88−
8992 mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
9093 tryCompare(textLabel, "height", initialTextLabelHeight)
9194
9295 // text SeeMore automatic hiding
9396 previewTextSummary.widgetData = widgetDataShortText
94−
9597 verify(textLabel.lineCount <= 7)
9698 compare(seeMore.visible, false)
9799 tryCompare(textLabel, "height", textLabel.contentHeight)