on xenial help sign in
PreviewExpandable should be not expanded on startup
3e619a4Albert Astals Cid
qml/Dash/Previews/PreviewWidgetFactory.qml+1−1
@@ -35,7 +35,7 @@ Loader {
35 property var scopeStyle: null
35 property var scopeStyle: null
36
36
37 //! Should the widget show in expanded mode (For those that support it)
37 //! Should the widget show in expanded mode (For those that support it)
38− property bool expanded: true
38+ property bool expanded: widgetType !== "expandable"
39
39
40 //! Set to true if the parent preview is displayed.
40 //! Set to true if the parent preview is displayed.
41 property bool isCurrentPreview: false
41 property bool isCurrentPreview: false
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+3−1
@@ -51,9 +51,10 @@ Rectangle {
51 widgetsModel.append({"type": "text", "widgetId": "text4", "properties": { "text": longText }});
51 widgetsModel.append({"type": "text", "widgetId": "text4", "properties": { "text": longText }});
52 }
52 }
53
53
54− PreviewExpandable {
54+ PreviewWidgetFactory {
55 id: previewExpandable
55 id: previewExpandable
56 anchors { left: parent.left; right: parent.right }
56 anchors { left: parent.left; right: parent.right }
57+ widgetType: "expandable"
57 widgetData: root.widgetData
58 widgetData: root.widgetData
58 }
59 }
59
60
@@ -77,6 +78,7 @@ Rectangle {
77 }
78 }
78
79
79 function init() {
80 function init() {
81+ checkInitialState();
80 }
82 }
81
83
82 function test_collapsed_by_default() {
84 function test_collapsed_by_default() {
tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml+15−14
@@ -75,20 +75,20 @@ Rectangle {
75
75
76 function test_mapping_data() {
76 function test_mapping_data() {
77 return [
77 return [
78− { tag: "Actions", type: "actions", source: "PreviewActions.qml" },
78+ { tag: "Actions", type: "actions", source: "PreviewActions.qml", expanded: true },
79− { tag: "Audio", type: "audio", source: "PreviewAudioPlayback.qml" },
79+ { tag: "Audio", type: "audio", source: "PreviewAudioPlayback.qml", expanded: true },
80− { tag: "Comment", type: "comment", source: "PreviewComment.qml" },
80+ { tag: "Comment", type: "comment", source: "PreviewComment.qml", expanded: true },
81− { tag: "Comment Input", type: "comment-input", source: "PreviewCommentInput.qml" },
81+ { tag: "Comment Input", type: "comment-input", source: "PreviewCommentInput.qml", expanded: true },
82− { tag: "Expandable", type: "expandable", source: "PreviewExpandable.qml" },
82+ { tag: "Expandable", type: "expandable", source: "PreviewExpandable.qml", expanded: false },
83− { tag: "Gallery", type: "gallery", source: "PreviewImageGallery.qml" },
83+ { tag: "Gallery", type: "gallery", source: "PreviewImageGallery.qml", expanded: true },
84− { tag: "Header", type: "header", source: "PreviewHeader.qml" },
84+ { tag: "Header", type: "header", source: "PreviewHeader.qml", expanded: true },
85− { tag: "Image", type: "image", source: "PreviewZoomableImage.qml" },
85+ { tag: "Image", type: "image", source: "PreviewZoomableImage.qml", expanded: true },
86− { tag: "Progress", type: "progress", source: "PreviewProgress.qml" },
86+ { tag: "Progress", type: "progress", source: "PreviewProgress.qml", expanded: true },
87− { tag: "Rating Input", type: "rating-input", source: "PreviewRatingInput.qml" },
87+ { tag: "Rating Input", type: "rating-input", source: "PreviewRatingInput.qml", expanded: true },
88− { tag: "Rating Display", type: "reviews", source: "PreviewRatingDisplay.qml" },
88+ { tag: "Rating Display", type: "reviews", source: "PreviewRatingDisplay.qml", expanded: true },
89− { tag: "Table", type: "table", source: "PreviewTable.qml" },
89+ { tag: "Table", type: "table", source: "PreviewTable.qml", expanded: true },
90− { tag: "Text", type: "text", source: "PreviewTextSummary.qml" },
90+ { tag: "Text", type: "text", source: "PreviewTextSummary.qml", expanded: true },
91− { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml" },
91+ { tag: "Video", type: "video", source: "PreviewVideoPlayback.qml", expanded: true },
92 ];
92 ];
93 }
93 }
94
94
@@ -97,6 +97,7 @@ Rectangle {
97 factory.widgetType = data.type;
97 factory.widgetType = data.type;
98
98
99 verify((String(factory.source)).indexOf(data.source) != -1);
99 verify((String(factory.source)).indexOf(data.source) != -1);
100+ compare(factory.item.expanded, data.expanded);
100 }
101 }
101 }
102 }
102}
103}