on xenial help sign in
PreviewExpandable should be not expanded on startup

Approved by: Andrea Cimitan

commit3e619a41f9fc8bafd0c5c9bbb0609456d41fcc0c authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 21 Jul 2015, 09:09 (11 years ago) parentc9074a5da50ad5
3 files changed+19−16
qml/Dash/Previews/PreviewWidgetFactory.qml+1−1 tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+3−1 tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml+15−14
qml/Dash/Previews/PreviewWidgetFactory.qml+1−1
@@ -35,7 +35,7 @@ Loader {
3535 property var scopeStyle: null
3636
3737 //! Should the widget show in expanded mode (For those that support it)
38− property bool expanded: true
38+ property bool expanded: widgetType !== "expandable"
3939
4040 //! Set to true if the parent preview is displayed.
4141 property bool isCurrentPreview: false
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+3−1
@@ -51,9 +51,10 @@ Rectangle {
5151 widgetsModel.append({"type": "text", "widgetId": "text4", "properties": { "text": longText }});
5252 }
5353
54− PreviewExpandable {
54+ PreviewWidgetFactory {
5555 id: previewExpandable
5656 anchors { left: parent.left; right: parent.right }
57+ widgetType: "expandable"
5758 widgetData: root.widgetData
5859 }
5960
@@ -77,6 +78,7 @@ Rectangle {
7778 }
7879
7980 function init() {
81+ checkInitialState();
8082 }
8183
8284 function test_collapsed_by_default() {
tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml+15−14
@@ -75,20 +75,20 @@ Rectangle {
7575
7676 function test_mapping_data() {
7777 return [
78− { tag: "Actions", type: "actions", source: "PreviewActions.qml" },
79− { tag: "Audio", type: "audio", source: "PreviewAudioPlayback.qml" },
80− { tag: "Comment", type: "comment", source: "PreviewComment.qml" },
81− { tag: "Comment Input", type: "comment-input", source: "PreviewCommentInput.qml" },
82− { tag: "Expandable", type: "expandable", source: "PreviewExpandable.qml" },
83− { tag: "Gallery", type: "gallery", source: "PreviewImageGallery.qml" },
84− { tag: "Header", type: "header", source: "PreviewHeader.qml" },
85− { tag: "Image", type: "image", source: "PreviewZoomableImage.qml" },
86− { tag: "Progress", type: "progress", source: "PreviewProgress.qml" },
87− { tag: "Rating Input", type: "rating-input", source: "PreviewRatingInput.qml" },
88− { tag: "Rating Display", type: "reviews", source: "PreviewRatingDisplay.qml" },
89− { tag: "Table", type: "table", source: "PreviewTable.qml" },
90− { tag: "Text", type: "text", source: "PreviewTextSummary.qml" },
91− { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml" },
78+ { tag: "Actions", type: "actions", source: "PreviewActions.qml", expanded: true },
79+ { tag: "Audio", type: "audio", source: "PreviewAudioPlayback.qml", expanded: true },
80+ { tag: "Comment", type: "comment", source: "PreviewComment.qml", expanded: true },
81+ { tag: "Comment Input", type: "comment-input", source: "PreviewCommentInput.qml", expanded: true },
82+ { tag: "Expandable", type: "expandable", source: "PreviewExpandable.qml", expanded: false },
83+ { tag: "Gallery", type: "gallery", source: "PreviewImageGallery.qml", expanded: true },
84+ { tag: "Header", type: "header", source: "PreviewHeader.qml", expanded: true },
85+ { tag: "Image", type: "image", source: "PreviewZoomableImage.qml", expanded: true },
86+ { tag: "Progress", type: "progress", source: "PreviewProgress.qml", expanded: true },
87+ { tag: "Rating Input", type: "rating-input", source: "PreviewRatingInput.qml", expanded: true },
88+ { tag: "Rating Display", type: "reviews", source: "PreviewRatingDisplay.qml", expanded: true },
89+ { tag: "Table", type: "table", source: "PreviewTable.qml", expanded: true },
90+ { tag: "Text", type: "text", source: "PreviewTextSummary.qml", expanded: true },
91+ { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml", expanded: true },
9292 ];
9393 }
9494
@@ -97,6 +97,7 @@ Rectangle {
9797 factory.widgetType = data.type;
9898
9999 verify((String(factory.source)).indexOf(data.source) != -1);
100+ compare(factory.item.expanded, data.expanded);
100101 }
101102 }
102103}