Merge lp:~unity-team/unity8/dash-filtergrid-renderers into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Francis Ginther
Approved revision: 382
Merged at revision: 388
Proposed branch: lp:~unity-team/unity8/dash-filtergrid-renderers
Merge into: lp:unity8
Prerequisite: lp:~mhr3/unity8/expose-renderer-hint
Diff against target: 392 lines (+271/-67)
7 files modified
Components/Tile.qml (+8/-64)
Components/TileStyle.qml (+80/-0)
Dash/Apps/DashPluginFilterGrid.qml (+49/-0)
Dash/Generic/FlatTileStyle.qml (+78/-0)
Dash/Generic/GenericFilterGrid.qml (+0/-3)
Dash/Generic/WeatherFilterGrid.qml (+49/-0)
Dash/GenericScopeView.qml (+7/-0)
To merge this branch: bzr merge lp:~unity-team/unity8/dash-filtergrid-renderers
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Cimitan (community) Approve
Michał Sawicz Approve
Review via email: mp+189160@code.launchpad.net

This proposal supersedes a proposal from 2013-10-03.

Commit message

Make Tile themeable, add renderers for Dash Plugins and weather.

Description of the change

Make Tile themeable, add renderers for Dash Plugins and weather

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Some of my code... but well...

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:380
http://jenkins.qa.ubuntu.com/job/unity8-ci/1252/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4489/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2263
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2067
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/275
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1252
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1252/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1251
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/771/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/364
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/364/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2265
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2265/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1937
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1951

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1252/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

> Some of my code... but well...
I reviewed your changes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/567/
Executed test runs:
    SUCCESS: http://s-jenkins:8080/job/generic-cleanup-mbs/2683
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4512
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2287/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2077
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-autolanding/152
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/571
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-autolanding/571/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-autolanding/571
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/796
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/387
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/387/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2289
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2289/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1963/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1976

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:382
http://jenkins.qa.ubuntu.com/job/unity8-ci/1254/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4515
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2290
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2079
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/277
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1254
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1254/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/799
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/390
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/390/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2292
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2292/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/1966
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/1980

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity8-ci/1254/rebuild

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/Tile.qml'
2--- Components/Tile.qml 2013-08-05 15:02:05 +0000
3+++ Components/Tile.qml 2013-10-03 19:16:07 +0000
4@@ -18,70 +18,14 @@
5 import Ubuntu.Components 0.1
6
7 AbstractButton {
8- id: root
9- property alias source: image.source
10- property alias fillMode: image.fillMode
11- property alias horizontalAlignment: image.horizontalAlignment
12- property alias verticalAlignment: image.verticalAlignment
13- property alias text: label.text
14+ property url source
15+ property int fillMode: Image.PreserveAspectCrop
16+ property int horizontalAlignment: Image.AlignHCenter
17+ property int verticalAlignment: Image.AlignVCenter
18+ property string text
19 property int imageWidth
20 property int imageHeight
21-
22- UbuntuShape {
23- id: icon
24- anchors {
25- top: parent.top
26- horizontalCenter: parent.horizontalCenter
27- }
28- radius: "medium"
29- width: imageWidth
30- height: imageHeight
31- image: Image {
32- id: image
33- objectName: "image"
34- sourceSize { width: icon.width; height: icon.height }
35- asynchronous: true
36- cache: false
37- }
38- }
39-
40- UbuntuShape {
41- id: borderPressed
42- objectName: "borderPressed"
43-
44- anchors.fill: icon
45- radius: "medium"
46- borderSource: "radius_pressed.sci"
47- opacity: root.pressed ? 1.0 : 0.0
48- Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
49- }
50-
51- Item {
52- anchors {
53- left: parent.left
54- right: parent.right
55- top: icon.bottom
56- }
57- height: units.gu(2)
58-
59- Label {
60- id: label
61- objectName: "label"
62- anchors {
63- baseline: parent.bottom
64- left: parent.left
65- right: parent.right
66- leftMargin: units.gu(1)
67- rightMargin: units.gu(1)
68- }
69-
70- color: Theme.palette.selected.backgroundText
71- opacity: 0.9
72- style: Text.Raised
73- styleColor: "black"
74- fontSize: "small"
75- elide: Text.ElideMiddle
76- horizontalAlignment: Text.AlignHCenter
77- }
78- }
79+ property int maximumLineCount: 1
80+
81+ style: TileStyle {}
82 }
83
84=== added file 'Components/TileStyle.qml'
85--- Components/TileStyle.qml 1970-01-01 00:00:00 +0000
86+++ Components/TileStyle.qml 2013-10-03 19:16:07 +0000
87@@ -0,0 +1,80 @@
88+/*
89+ * Copyright (C) 2013 Canonical, Ltd.
90+ *
91+ * This program is free software; you can redistribute it and/or modify
92+ * it under the terms of the GNU General Public License as published by
93+ * the Free Software Foundation; version 3.
94+ *
95+ * This program is distributed in the hope that it will be useful,
96+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
97+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98+ * GNU General Public License for more details.
99+ *
100+ * You should have received a copy of the GNU General Public License
101+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
102+ */
103+
104+import QtQuick 2.0
105+import Ubuntu.Components 0.1
106+
107+Item {
108+ id: tile
109+
110+ anchors.fill: parent
111+
112+ UbuntuShape {
113+ id: icon
114+ anchors {
115+ top: parent.top
116+ horizontalCenter: parent.horizontalCenter
117+ }
118+ radius: "medium"
119+ width: styledItem.imageWidth
120+ height: styledItem.imageHeight
121+ image: Image {
122+ id: image
123+ objectName: "image"
124+ sourceSize { width: icon.width; height: icon.height }
125+ asynchronous: true
126+ cache: false
127+ source: styledItem.source
128+ fillMode: styledItem.fillMode
129+ horizontalAlignment: styledItem.horizontalAlignment
130+ verticalAlignment: styledItem.verticalAlignment
131+ }
132+ }
133+
134+ UbuntuShape {
135+ id: borderPressed
136+ objectName: "borderPressed"
137+
138+ anchors.fill: icon
139+ radius: "medium"
140+ borderSource: "radius_pressed.sci"
141+ opacity: styledItem.pressed ? 1.0 : 0.0
142+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
143+ }
144+
145+ Label {
146+ id: label
147+ objectName: "label"
148+ anchors {
149+ baseline: icon.bottom
150+ baselineOffset: units.gu(2)
151+ left: parent.left
152+ right: parent.right
153+ leftMargin: units.gu(1)
154+ rightMargin: units.gu(1)
155+ }
156+
157+ color: Theme.palette.selected.backgroundText
158+ opacity: 0.9
159+ style: Text.Raised
160+ styleColor: "black"
161+ fontSize: "small"
162+ elide: Text.ElideMiddle
163+ horizontalAlignment: Text.AlignHCenter
164+ text: styledItem.text
165+ maximumLineCount: styledItem.maximumLineCount
166+ }
167+}
168
169=== added file 'Dash/Apps/DashPluginFilterGrid.qml'
170--- Dash/Apps/DashPluginFilterGrid.qml 1970-01-01 00:00:00 +0000
171+++ Dash/Apps/DashPluginFilterGrid.qml 2013-10-03 19:16:07 +0000
172@@ -0,0 +1,49 @@
173+/*
174+ * Copyright (C) 2013 Canonical, Ltd.
175+ *
176+ * This program is free software; you can redistribute it and/or modify
177+ * it under the terms of the GNU General Public License as published by
178+ * the Free Software Foundation; version 3.
179+ *
180+ * This program is distributed in the hope that it will be useful,
181+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
182+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
183+ * GNU General Public License for more details.
184+ *
185+ * You should have received a copy of the GNU General Public License
186+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
187+ */
188+
189+import QtQuick 2.0
190+import Ubuntu.Components 0.1
191+import "../../Components"
192+import "../Generic"
193+
194+GenericFilterGrid {
195+ id: filtergrid
196+
197+ delegate: Tile {
198+ id: tile
199+ objectName: "delegate" + index
200+ width: filtergrid.cellWidth
201+ height: filtergrid.cellHeight
202+ text: model.title
203+ imageWidth: filtergrid.iconWidth
204+ imageHeight: filtergrid.iconHeight
205+ source: model.icon
206+
207+ style: FlatTileStyle {
208+ disabled: model.rendererHints['scope_disabled'] === 1;
209+ }
210+
211+ onClicked: {
212+ var data = { model: model }
213+ filtergrid.clicked(index, data, tile.y)
214+ }
215+
216+ onPressAndHold: {
217+ var data = { model: model }
218+ filtergrid.pressAndHold(index, data, tile.y)
219+ }
220+ }
221+}
222
223=== added file 'Dash/Generic/FlatTileStyle.qml'
224--- Dash/Generic/FlatTileStyle.qml 1970-01-01 00:00:00 +0000
225+++ Dash/Generic/FlatTileStyle.qml 2013-10-03 19:16:07 +0000
226@@ -0,0 +1,78 @@
227+/*
228+ * Copyright (C) 2013 Canonical, Ltd.
229+ *
230+ * This program is free software; you can redistribute it and/or modify
231+ * it under the terms of the GNU General Public License as published by
232+ * the Free Software Foundation; version 3.
233+ *
234+ * This program is distributed in the hope that it will be useful,
235+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
236+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
237+ * GNU General Public License for more details.
238+ *
239+ * You should have received a copy of the GNU General Public License
240+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
241+ */
242+
243+import QtQuick 2.0
244+import Ubuntu.Components 0.1
245+
246+Item {
247+ id: tile
248+
249+ property bool disabled: false
250+
251+ anchors.fill: parent
252+
253+ Image {
254+ id: icon
255+ objectName: "image"
256+ width: styledItem.imageWidth
257+ height: styledItem.imageHeight
258+
259+ anchors.horizontalCenter: parent.horizontalCenter
260+
261+ sourceSize { width: width; height: height }
262+ asynchronous: true
263+ cache: false
264+ source: styledItem.source
265+ fillMode: styledItem.fillMode
266+ opacity: tile.disabled ? 0.3 : 1.0
267+ horizontalAlignment: styledItem.horizontalAlignment
268+ verticalAlignment: styledItem.verticalAlignment
269+ }
270+
271+ UbuntuShape {
272+ id: borderPressed
273+ objectName: "borderPressed"
274+
275+ anchors.fill: icon
276+ radius: "medium"
277+ borderSource: "radius_pressed.sci"
278+ opacity: styledItem.pressed ? 1.0 : 0.0
279+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
280+ }
281+
282+ Label {
283+ id: label
284+ objectName: "label"
285+ anchors {
286+ baseline: icon.bottom
287+ baselineOffset: units.gu(2)
288+ left: parent.left
289+ right: parent.right
290+ leftMargin: units.gu(1)
291+ rightMargin: units.gu(1)
292+ }
293+
294+ color: Theme.palette.selected.backgroundText
295+ opacity: 0.9
296+ style: Text.Raised
297+ styleColor: "black"
298+ fontSize: "small"
299+ elide: Text.ElideMiddle
300+ horizontalAlignment: Text.AlignHCenter
301+ text: styledItem.text
302+ maximumLineCount: styledItem.maximumLineCount
303+ }
304+}
305
306=== modified file 'Dash/Generic/GenericFilterGrid.qml'
307--- Dash/Generic/GenericFilterGrid.qml 2013-09-05 10:02:00 +0000
308+++ Dash/Generic/GenericFilterGrid.qml 2013-10-03 19:16:07 +0000
309@@ -39,11 +39,8 @@
310 text: model.title
311 imageWidth: filtergrid.iconWidth
312 imageHeight: filtergrid.iconHeight
313-
314 source: model.icon
315
316- fillMode: Image.PreserveAspectCrop
317-
318 onClicked: {
319 var data = { model: model }
320 filtergrid.clicked(index, data, tile.y)
321
322=== added file 'Dash/Generic/WeatherFilterGrid.qml'
323--- Dash/Generic/WeatherFilterGrid.qml 1970-01-01 00:00:00 +0000
324+++ Dash/Generic/WeatherFilterGrid.qml 2013-10-03 19:16:07 +0000
325@@ -0,0 +1,49 @@
326+/*
327+ * Copyright (C) 2013 Canonical, Ltd.
328+ *
329+ * This program is free software; you can redistribute it and/or modify
330+ * it under the terms of the GNU General Public License as published by
331+ * the Free Software Foundation; version 3.
332+ *
333+ * This program is distributed in the hope that it will be useful,
334+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
335+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
336+ * GNU General Public License for more details.
337+ *
338+ * You should have received a copy of the GNU General Public License
339+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
340+ */
341+
342+import QtQuick 2.0
343+import Ubuntu.Components 0.1
344+import "../../Components"
345+
346+GenericFilterGrid {
347+ id: filtergrid
348+
349+ delegateHeight: units.gu(11.5)
350+
351+ delegate: Tile {
352+ id: tile
353+ objectName: "delegate" + index
354+ width: filtergrid.cellWidth
355+ height: filtergrid.cellHeight
356+ text: model.title
357+ imageWidth: filtergrid.iconWidth
358+ imageHeight: filtergrid.iconHeight
359+ source: model.icon
360+ maximumLineCount: 2
361+
362+ style: FlatTileStyle {}
363+
364+ onClicked: {
365+ var data = { model: model }
366+ filtergrid.clicked(index, data, tile.y)
367+ }
368+
369+ onPressAndHold: {
370+ var data = { model: model }
371+ filtergrid.pressAndHold(index, data, tile.y)
372+ }
373+ }
374+}
375
376=== modified file 'Dash/GenericScopeView.qml'
377--- Dash/GenericScopeView.qml 2013-10-03 19:16:06 +0000
378+++ Dash/GenericScopeView.qml 2013-10-03 19:16:07 +0000
379@@ -209,6 +209,13 @@
380 switch (contentType) {
381 case "video": return "Generic/GenericFilterGridPotrait.qml";
382 case "music": return "Music/MusicFilterGrid.qml";
383+ case "apps": {
384+ if (rendererHint == "toggled")
385+ return "Apps/DashPluginFilterGrid.qml";
386+ else
387+ return "Generic/GenericFilterGrid.qml";
388+ }
389+ case "weather": return "Generic/WeatherFilterGrid.qml";
390 default: return "Generic/GenericFilterGrid.qml";
391 }
392 }

Subscribers

People subscribed via source and target branches