Merge lp:~cimi/unity8/dash-filtergrid-renderers into lp:unity8

Proposed by Andrea Cimitan
Status: Superseded
Proposed branch: lp:~cimi/unity8/dash-filtergrid-renderers
Merge into: lp:unity8
Prerequisite: lp:~mhr3/unity8/expose-renderer-hint
Diff against target: 450 lines (+301/-66)
9 files modified
Components/Tile.qml (+6/-63)
Components/TileStyle.qml (+87/-0)
Dash/Apps/DashPluginFilterGrid.qml (+50/-0)
Dash/Generic/FlatTileStyle.qml (+90/-0)
Dash/Generic/GenericFilterGrid.qml (+0/-2)
Dash/Generic/WeatherFilterGrid.qml (+47/-0)
Dash/GenericScopeView.qml (+7/-0)
plugins/Unity/categoryresults.cpp (+12/-0)
plugins/Unity/categoryresults.h (+2/-1)
To merge this branch: bzr merge lp:~cimi/unity8/dash-filtergrid-renderers
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity Team Pending
Review via email: mp+189128@code.launchpad.net

This proposal has been superseded by 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.
377. By Andrea Cimitan

Add fixme

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

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Components/Tile.qml'
--- Components/Tile.qml 2013-08-05 15:02:05 +0000
+++ Components/Tile.qml 2013-10-03 16:28:24 +0000
@@ -18,70 +18,13 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
1919
20AbstractButton {20AbstractButton {
21 id: root21 property url source
22 property alias source: image.source22 property int fillMode
23 property alias fillMode: image.fillMode23 property int horizontalAlignment
24 property alias horizontalAlignment: image.horizontalAlignment24 property int verticalAlignment
25 property alias verticalAlignment: image.verticalAlignment25 property string text
26 property alias text: label.text
27 property int imageWidth26 property int imageWidth
28 property int imageHeight27 property int imageHeight
2928
30 UbuntuShape {29 style: TileStyle {}
31 id: icon
32 anchors {
33 top: parent.top
34 horizontalCenter: parent.horizontalCenter
35 }
36 radius: "medium"
37 width: imageWidth
38 height: imageHeight
39 image: Image {
40 id: image
41 objectName: "image"
42 sourceSize { width: icon.width; height: icon.height }
43 asynchronous: true
44 cache: false
45 }
46 }
47
48 UbuntuShape {
49 id: borderPressed
50 objectName: "borderPressed"
51
52 anchors.fill: icon
53 radius: "medium"
54 borderSource: "radius_pressed.sci"
55 opacity: root.pressed ? 1.0 : 0.0
56 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
57 }
58
59 Item {
60 anchors {
61 left: parent.left
62 right: parent.right
63 top: icon.bottom
64 }
65 height: units.gu(2)
66
67 Label {
68 id: label
69 objectName: "label"
70 anchors {
71 baseline: parent.bottom
72 left: parent.left
73 right: parent.right
74 leftMargin: units.gu(1)
75 rightMargin: units.gu(1)
76 }
77
78 color: Theme.palette.selected.backgroundText
79 opacity: 0.9
80 style: Text.Raised
81 styleColor: "black"
82 fontSize: "small"
83 elide: Text.ElideMiddle
84 horizontalAlignment: Text.AlignHCenter
85 }
86 }
87}30}
8831
=== added file 'Components/TileStyle.qml'
--- Components/TileStyle.qml 1970-01-01 00:00:00 +0000
+++ Components/TileStyle.qml 2013-10-03 16:28:24 +0000
@@ -0,0 +1,87 @@
1/*
2 * Copyright (C) 2013 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
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20Item {
21 id: tile
22
23 anchors.fill: parent
24
25 UbuntuShape {
26 id: icon
27 anchors {
28 top: parent.top
29 horizontalCenter: parent.horizontalCenter
30 }
31 radius: "medium"
32 width: styledItem.imageWidth
33 height: styledItem.imageHeight
34 image: Image {
35 id: image
36 objectName: "image"
37 sourceSize { width: icon.width; height: icon.height }
38 asynchronous: true
39 cache: false
40 source: styledItem.source
41 fillMode: styledItem.fillMode
42 horizontalAlignment: styledItem.horizontalAlignment
43 verticalAlignment: styledItem.verticalAlignment
44 }
45 }
46
47 UbuntuShape {
48 id: borderPressed
49 objectName: "borderPressed"
50
51 anchors.fill: icon
52 radius: "medium"
53 borderSource: "radius_pressed.sci"
54 opacity: styledItem.pressed ? 1.0 : 0.0
55 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
56 }
57
58 Item {
59 anchors {
60 left: parent.left
61 right: parent.right
62 top: icon.bottom
63 }
64 height: units.gu(2)
65
66 Label {
67 id: label
68 objectName: "label"
69 anchors {
70 baseline: parent.bottom
71 left: parent.left
72 right: parent.right
73 leftMargin: units.gu(1)
74 rightMargin: units.gu(1)
75 }
76
77 color: Theme.palette.selected.backgroundText
78 opacity: 0.9
79 style: Text.Raised
80 styleColor: "black"
81 fontSize: "small"
82 elide: Text.ElideMiddle
83 horizontalAlignment: Text.AlignHCenter
84 text: styledItem.text
85 }
86 }
87}
088
=== added file 'Dash/Apps/DashPluginFilterGrid.qml'
--- Dash/Apps/DashPluginFilterGrid.qml 1970-01-01 00:00:00 +0000
+++ Dash/Apps/DashPluginFilterGrid.qml 2013-10-03 16:28:24 +0000
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2013 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
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../../Components"
20import "../Generic"
21
22GenericFilterGrid {
23 id: filtergrid
24
25 delegate: Tile {
26 id: tile
27 objectName: "delegate" + index
28 width: filtergrid.cellWidth
29 height: filtergrid.cellHeight
30 text: model.title
31 imageWidth: filtergrid.iconWidth
32 imageHeight: filtergrid.iconHeight
33 source: model.icon
34 fillMode: Image.PreserveAspectCrop
35
36 style: FlatTileStyle {
37 disabled: model.scopeDisabled
38 }
39
40 onClicked: {
41 var data = { model: model }
42 filtergrid.clicked(index, data, tile.y)
43 }
44
45 onPressAndHold: {
46 var data = { model: model }
47 filtergrid.pressAndHold(index, data, tile.y)
48 }
49 }
50}
051
=== added file 'Dash/Generic/FlatTileStyle.qml'
--- Dash/Generic/FlatTileStyle.qml 1970-01-01 00:00:00 +0000
+++ Dash/Generic/FlatTileStyle.qml 2013-10-03 16:28:24 +0000
@@ -0,0 +1,90 @@
1/*
2 * Copyright (C) 2013 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
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20Item {
21 id: tile
22
23 property bool disabled: false
24
25 anchors.fill: parent
26
27 Item {
28 id: icon
29 anchors {
30 top: parent.top
31 horizontalCenter: parent.horizontalCenter
32 }
33 width: styledItem.imageWidth
34 height: styledItem.imageHeight
35
36 Image {
37 id: image
38 objectName: "image"
39 sourceSize { width: icon.width; height: icon.height }
40 asynchronous: true
41 cache: false
42 source: styledItem.source
43 fillMode: styledItem.fillMode
44 opacity: tile.disabled ? 0.5 : 1.0
45 horizontalAlignment: styledItem.horizontalAlignment
46 verticalAlignment: styledItem.verticalAlignment
47 }
48 }
49
50 UbuntuShape {
51 id: borderPressed
52 objectName: "borderPressed"
53
54 anchors.fill: icon
55 radius: "medium"
56 borderSource: "radius_pressed.sci"
57 opacity: styledItem.pressed ? 1.0 : 0.0
58 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
59 }
60
61 Item {
62 anchors {
63 left: parent.left
64 right: parent.right
65 top: icon.bottom
66 }
67 height: units.gu(2)
68
69 Label {
70 id: label
71 objectName: "label"
72 anchors {
73 baseline: parent.bottom
74 left: parent.left
75 right: parent.right
76 leftMargin: units.gu(1)
77 rightMargin: units.gu(1)
78 }
79
80 color: Theme.palette.selected.backgroundText
81 opacity: 0.9
82 style: Text.Raised
83 styleColor: "black"
84 fontSize: "small"
85 elide: Text.ElideMiddle
86 horizontalAlignment: Text.AlignHCenter
87 text: styledItem.text
88 }
89 }
90}
091
=== modified file 'Dash/Generic/GenericFilterGrid.qml'
--- Dash/Generic/GenericFilterGrid.qml 2013-09-05 10:02:00 +0000
+++ Dash/Generic/GenericFilterGrid.qml 2013-10-03 16:28:24 +0000
@@ -39,9 +39,7 @@
39 text: model.title39 text: model.title
40 imageWidth: filtergrid.iconWidth40 imageWidth: filtergrid.iconWidth
41 imageHeight: filtergrid.iconHeight41 imageHeight: filtergrid.iconHeight
42
43 source: model.icon42 source: model.icon
44
45 fillMode: Image.PreserveAspectCrop43 fillMode: Image.PreserveAspectCrop
4644
47 onClicked: {45 onClicked: {
4846
=== added file 'Dash/Generic/WeatherFilterGrid.qml'
--- Dash/Generic/WeatherFilterGrid.qml 1970-01-01 00:00:00 +0000
+++ Dash/Generic/WeatherFilterGrid.qml 2013-10-03 16:28:24 +0000
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2013 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
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../../Components"
20
21GenericFilterGrid {
22 id: filtergrid
23
24 delegate: Tile {
25 id: tile
26 objectName: "delegate" + index
27 width: filtergrid.cellWidth
28 height: filtergrid.cellHeight
29 text: model.title
30 imageWidth: filtergrid.iconWidth
31 imageHeight: filtergrid.iconHeight
32 source: model.icon
33 fillMode: Image.PreserveAspectCrop
34
35 style: FlatTileStyle {}
36
37 onClicked: {
38 var data = { model: model }
39 filtergrid.clicked(index, data, tile.y)
40 }
41
42 onPressAndHold: {
43 var data = { model: model }
44 filtergrid.pressAndHold(index, data, tile.y)
45 }
46 }
47}
048
=== modified file 'Dash/GenericScopeView.qml'
--- Dash/GenericScopeView.qml 2013-10-03 16:28:24 +0000
+++ Dash/GenericScopeView.qml 2013-10-03 16:28:24 +0000
@@ -209,6 +209,13 @@
209 switch (contentType) {209 switch (contentType) {
210 case "video": return "Generic/GenericFilterGridPotrait.qml";210 case "video": return "Generic/GenericFilterGridPotrait.qml";
211 case "music": return "Music/MusicFilterGrid.qml";211 case "music": return "Music/MusicFilterGrid.qml";
212 case "apps": {
213 if (rendererHint == "toggled")
214 return "Apps/DashPluginFilterGrid.qml";
215 else
216 return "Generic/GenericFilterGrid.qml";
217 }
218 case "weather": return "Generic/WeatherFilterGrid.qml";
212 default: return "Generic/GenericFilterGrid.qml";219 default: return "Generic/GenericFilterGrid.qml";
213 }220 }
214 }221 }
215222
=== modified file 'plugins/Unity/categoryresults.cpp'
--- plugins/Unity/categoryresults.cpp 2013-10-01 15:46:09 +0000
+++ plugins/Unity/categoryresults.cpp 2013-10-03 16:28:24 +0000
@@ -46,6 +46,7 @@
46 m_roles[CategoryResults::RoleComment] = "comment";46 m_roles[CategoryResults::RoleComment] = "comment";
47 m_roles[CategoryResults::RoleDndUri] = "dndUri";47 m_roles[CategoryResults::RoleDndUri] = "dndUri";
48 m_roles[CategoryResults::RoleMetadata] = "metadata";48 m_roles[CategoryResults::RoleMetadata] = "metadata";
49 m_roles[CategoryResults::RoleMetadataScopeDisabled] = "scopeDisabled";
49}50}
5051
51int CategoryResults::categoryIndex() const52int CategoryResults::categoryIndex() const
@@ -100,6 +101,17 @@
100 return DeeListModel::data(index, ResultsColumn::DND_URI);101 return DeeListModel::data(index, ResultsColumn::DND_URI);
101 case RoleMetadata:102 case RoleMetadata:
102 return DeeListModel::data(index, ResultsColumn::METADATA);103 return DeeListModel::data(index, ResultsColumn::METADATA);
104 // FIXME nasty hack while we don't support annotated icons
105 case RoleMetadataScopeDisabled: {
106 QVariantHash hash(DeeListModel::data(index, ResultsColumn::METADATA).toHash());
107 if (hash.contains("content")) {
108 QVariantHash innerHash(hash["content"].toHash());
109 if (innerHash.contains("scope_disabled")) {
110 return innerHash["scope_disabled"];
111 }
112 }
113 return QVariant();
114 }
103 default:115 default:
104 return QVariant();116 return QVariant();
105 }117 }
106118
=== modified file 'plugins/Unity/categoryresults.h'
--- plugins/Unity/categoryresults.h 2013-09-05 11:48:57 +0000
+++ plugins/Unity/categoryresults.h 2013-10-03 16:28:24 +0000
@@ -43,7 +43,8 @@
43 RoleTitle,43 RoleTitle,
44 RoleComment,44 RoleComment,
45 RoleDndUri,45 RoleDndUri,
46 RoleMetadata46 RoleMetadata,
47 RoleMetadataScopeDisabled
47 };48 };
4849
49 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;50 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;

Subscribers

People subscribed via source and target branches