on xenial help sign in
Merge
commitb1ddcfbb02dc74f7a712e2678f6e876e996c1066 authorAlbert Astals <albert.astals@canonical.com> dateWed 12 Feb 2014, 09:39 (13 years ago) parent2f4a3f61733e4a
16 files changed+154−57
debian/changelog+32 qml/Components/ListItems/Header.qml+3−13 qml/Dash/Card.qml+2 qml/Dash/CardFilterGrid.qml+1−1 qml/Dash/CardHeader.qml+4−5 qml/Dash/DashContent.qml+8 qml/Dash/DashFilterGrid.qml+1−1 qml/Dash/GenericScopeView.qml+2 qml/Dash/PreviewListView.qml−5 qml/Dash/Previews/PreviewZoomableImage.qml+41 qml/Dash/graphics/paper_landscape@27.png qml/Dash/graphics/paper_portrait@27.png qml/Shell.qml−30 tests/qmltests/CMakeLists.txt+1 tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+2−2 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+57
debian/changelog+32
@@ -1,3 +1,35 @@
1+unity8 (7.84+14.04.20140207.1-0ubuntu1) trusty; urgency=low
2+
3+ [ Ted Gould ]
4+ * You can't tap anywhere
5+
6+ [ Michał Sawicz ]
7+ * Wait for the indicator to appear.
8+ * Add CardTool to determine category-wide card properties based on the
9+ category template. Clean up test configurations, too.
10+ * Actions Preview Widget
11+ * Add Preview for new generation scopes.
12+ * Add overlay to card. Fix implicit card height. .
13+
14+ [ Albert Astals ]
15+ * Basic ImageGallery widget for Previews Mostly a copy of the code
16+ used in AppPreview.qml but without the MouseArea hack that I'll wait
17+ to introduce until we start using this somewhere were it is needed
18+ * Actions Preview Widget
19+
20+ [ Andrea Cimitan ]
21+ * First audio player widget for previews, with tests
22+ * Adds TextSummary preview widget
23+
24+ [ Michał Karnicki ]
25+ * Add overlay to card. Fix implicit card height. .
26+
27+ [ Michael Terry ]
28+ * Expand greeter demo support to include listing multiple users and
29+ specifying individual passwords and names.
30+
31+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 07 Feb 2014 10:46:46 +0000
32+
133unity8 (7.84+14.04.20140204-0ubuntu1) trusty; urgency=low
234
335 [ Michael Terry ]
qml/Components/ListItems/Header.qml+3−13
@@ -36,7 +36,7 @@ Item {
3636 right: parent.right
3737 rightMargin: units.gu(0.5)
3838 top: parent.top
39− bottom: bottomBorder.top
39+ bottom: parent.bottom
4040 }
4141
4242 Label {
@@ -47,14 +47,13 @@ Item {
4747 verticalCenter: parent.verticalCenter
4848 }
4949
50− color: Theme.palette.selected.backgroundText //at 60%
50+ // TODO karni: Fix when Ubuntu color pallete is updated.
51+ color: "grey" // Theme.palette.selected.backgroundText //at 60%
5152 opacity: 0.6
5253 font.family: "Ubuntu"
5354 fontSize: "medium"
5455 elide: Text.ElideRight
5556 textFormat: Text.PlainText
56− style: Text.Raised
57− styleColor: "black"
5857 width: parent.width - image.width - image.leftMargin - anchors.leftMargin
5958 }
6059
@@ -68,15 +67,6 @@ Item {
6867 }
6968 }
7069
71− ThinDivider {
72− id: bottomBorder
73− anchors {
74− left: parent.left
75− right: parent.right
76− bottom: parent.bottom
77− }
78− }
79−
8070 MouseArea {
8171 anchors.fill: parent
8272 onClicked: parent.clicked(mouse)
qml/Dash/Card.qml+2
@@ -143,5 +143,7 @@ AbstractButton {
143143 text: cardData && cardData["summary"] || ""
144144 height: text ? implicitHeight : 0
145145 fontSize: "small"
146+ // TODO karni (for each Label): Update Ubuntu.Components.Themes.Palette and use theme color instead
147+ color: "grey"
146148 }
147149}
qml/Dash/CardFilterGrid.qml+1−1
@@ -23,7 +23,7 @@ DashFilterGrid {
2323 minimumHorizontalSpacing: units.gu(0.5)
2424 delegateWidth: cardTool.cardWidth
2525 delegateHeight: cardTool.cardHeight
26− verticalSpacing: units.gu(2)
26+ verticalSpacing: units.gu(1)
2727
2828 CardTool {
2929 id: cardTool
qml/Dash/CardHeader.qml+4−5
@@ -81,9 +81,9 @@ Item {
8181 font.weight: Font.DemiBold
8282 wrapMode: Text.Wrap
8383 maximumLineCount: 2
84− fontSize: "small"
8584 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
86− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
85+ // TODO karni (for each Label): Update Ubuntu.Components.Themes.Palette and use theme color instead
86+ color: template["overlay"] === true ? "white" : "grey" // Theme.palette.normal.backgroundText
8787 }
8888
8989 Label {
@@ -93,9 +93,8 @@ Item {
9393 elide: Text.ElideRight
9494 font.weight: Font.Light
9595 visible: titleLabel.text && text
96− fontSize: "x-small"
9796 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
98− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
97+ color: template["overlay"] === true ? "white" : "grey" // Theme.palette.normal.backgroundText
9998 }
10099
101100 Row {
@@ -116,7 +115,7 @@ Item {
116115 width: parent.labelWidth
117116 elide: Text.ElideRight
118117 font.weight: Font.DemiBold
119− color: Theme.palette.selected.foreground
118+ color: "grey" // Theme.palette.normal.backgroundText
120119 visible: text
121120 }
122121
qml/Dash/DashContent.qml+8
@@ -80,6 +80,14 @@ Item {
8080 }
8181 }
8282
83+ Image {
84+ anchors.fill: parent
85+ source: shell.width > shell.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
86+ fillMode: Image.PreserveAspectCrop
87+ horizontalAlignment: Image.AlignRight
88+ verticalAlignment: Image.AlignTop
89+ }
90+
8391 Item {
8492 id: dashContentListHolder
8593 anchors.fill: parent
qml/Dash/DashFilterGrid.qml+1−1
@@ -26,6 +26,7 @@ DashRenderer {
2626 property alias delegate: filterGrid.delegate
2727 property alias delegateWidth: filterGrid.delegateWidth
2828 property alias delegateHeight: filterGrid.delegateHeight
29+ property alias verticalSpacing: filterGrid.verticalSpacing
2930 property alias maximumNumberOfColumns: filterGrid.maximumNumberOfColumns
3031 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
3132
@@ -40,7 +41,6 @@ DashRenderer {
4041 height: filterGrid.height
4142 margins: filterGrid.margins
4243 uncollapsedHeight: filterGrid.uncollapsedHeight
43− verticalSpacing: filterGrid.verticalSpacing
4444
4545 function startFilterAnimation(filter) {
4646 filterGrid.startFilterAnimation(filter)
qml/Dash/GenericScopeView.qml+2
@@ -193,6 +193,7 @@ FocusScope {
193193 previewListView.categoryId = categoryId
194194 previewListView.categoryDelegate = rendererLoader.item
195195 previewListView.model = target.model;
196+ previewListView.currentIndex = -1
196197 previewListView.currentIndex = index;
197198
198199 var item = target.model.get(index);
@@ -209,6 +210,7 @@ FocusScope {
209210 previewListView.categoryId = categoryId
210211 previewListView.categoryDelegate = rendererLoader.item
211212 previewListView.model = target.model;
213+ previewListView.currentIndex = -1
212214 previewListView.currentIndex = index;
213215 previewListView.open = true
214216 }
qml/Dash/PreviewListView.qml−5
@@ -173,11 +173,6 @@ Item {
173173 to: 1.0
174174 duration: UbuntuAnimation.BriskDuration
175175 }
176−
177− ActivityIndicator {
178− anchors.centerIn: parent
179− running: visible
180− }
181176 }
182177 }
183178}
qml/Dash/Previews/PreviewZoomableImage.qmlnew file+41
@@ -0,0 +1,41 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import "../../Components"
20+
21+/*! \brief Preview widget for image.
22+
23+ This widget shows image contained in widgetData["source"],
24+ can be zoomable accordingly with widgetData["zoomable"].
25+ */
26+
27+PreviewWidget {
28+ id: root
29+ implicitHeight: units.gu(22)
30+
31+ LazyImage {
32+ objectName: "image"
33+ anchors {
34+ top: parent.top
35+ bottom: parent.bottom
36+ }
37+ scaleTo: "height"
38+ source: widgetData["source"]
39+ initialWidth: units.gu(13)
40+ }
41+}
qml/Dash/graphics/paper_landscape@27.pngnew file

Binary file not shown.

qml/Dash/graphics/paper_portrait@27.pngnew file

Binary file not shown.

qml/Shell.qml−30
@@ -125,27 +125,6 @@ FocusScope {
125125 shell.background = gSettingsPicture
126126 }
127127
128− // This is a dummy image that is needed to determine if the picture url
129− // in backgroundSettings points to a valid picture file.
130− // We can't do this with the real background image because setting a
131− // new source in onStatusChanged triggers a binding loop detection
132− // inside Image, which causes it not to render even though a valid source
133− // would be set. We don't mind about this image staying black and just
134− // use it for verification to populate the source for the real
135− // background image.
136− Image {
137− source: shell.background
138− height: 0
139− width: 0
140− sourceSize.height: 0
141− sourceSize.width: 0
142− onStatusChanged: {
143− if (status == Image.Error && source != shell.defaultBackground) {
144− shell.background = defaultBackground
145− }
146− }
147− }
148−
149128 VolumeControl {
150129 id: volumeControl
151130 }
@@ -174,15 +153,6 @@ FocusScope {
174153 // through the translucent parts of the shell surface.
175154 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
176155
177− CrossFadeImage {
178− id: backgroundImage
179− objectName: "backgroundImage"
180−
181− anchors.fill: parent
182− source: shell.background
183− fillMode: Image.PreserveAspectCrop
184− }
185−
186156 Rectangle {
187157 anchors.fill: parent
188158 color: "black"
tests/qmltests/CMakeLists.txt+1
@@ -61,6 +61,7 @@ add_qml_test(Dash/Previews PreviewActions IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_
6161add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
6262add_qml_test(Dash/Previews PreviewImageGallery IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
6363add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
64+add_qml_test(Dash/Previews PreviewZoomableImage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
6465add_qml_test(Greeter Lockscreen IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
6566 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
6667add_qml_test(Greeter Tablet IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+2−2
@@ -23,7 +23,7 @@ Rectangle {
2323 id: root
2424 width: units.gu(60)
2525 height: units.gu(80)
26− color: "grey"
26+ color: "lightgrey"
2727
2828 property var sourcesModel0: {
2929 "sources": []
@@ -44,7 +44,7 @@ Rectangle {
4444 }
4545
4646 UT.UnityTestCase {
47− name: "ImageGalleryTest"
47+ name: "PreviewImageGalleryTest"
4848 when: windowShown
4949
5050 function test_changeEmptyModel() {
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qmlnew file+57
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import "../../../../qml/Dash/Previews"
20+import Unity.Test 0.1 as UT
21+
22+Rectangle {
23+ id: root
24+ width: units.gu(40)
25+ height: units.gu(80)
26+ color: "lightgrey"
27+
28+ property var widgetData0: {
29+ "source": ""
30+ }
31+
32+ property var widgetData1: {
33+ "source": "../../graphics/phone_background.jpg",
34+ "zoomable": false
35+ }
36+
37+ PreviewZoomableImage {
38+ id: zoomableImage
39+ width: parent.width
40+ widgetData: widgetData1
41+ }
42+
43+ UT.UnityTestCase {
44+ name: "PreviewZoomableImageTest"
45+ when: windowShown
46+
47+ function test_loadImage() {
48+ var image = findChild(zoomableImage, "image");
49+
50+ zoomableImage.widgetData = widgetData0;
51+ tryCompare(image.state, "default");
52+
53+ zoomableImage.widgetData = widgetData1;
54+ tryCompare(image.state, "ready");
55+ }
56+ }
57+}