on xenial help sign in
Starting to get shape
053eaecAlbert Astals
qml/Dash/CardFilterGrid.qml+1
@@ -53,6 +53,7 @@ DashRenderer {
53 item.objectName = "delegate" + index;
53 item.objectName = "delegate" + index;
54 item.width = Qt.binding(function() { return cardTool.cardWidth; });
54 item.width = Qt.binding(function() { return cardTool.cardWidth; });
55 item.height = Qt.binding(function() { return cardTool.cardHeight; });
55 item.height = Qt.binding(function() { return cardTool.cardHeight; });
56+ item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
56 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
57 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
57 item.cardData = Qt.binding(function() { return model; });
58 item.cardData = Qt.binding(function() { return model; });
58 item.template = Qt.binding(function() { return cardTool.template; });
59 item.template = Qt.binding(function() { return cardTool.template; });
qml/Dash/DashContent.qml+2
@@ -103,6 +103,7 @@ Item {
103 overviewController.progress = 0;
103 overviewController.progress = 0;
104 overviewController.accepted = false;
104 overviewController.accepted = false;
105 }
105 }
106+ scopeScale: dashContentListHolder.scale
106 }
107 }
107
108
108 Item {
109 Item {
@@ -196,6 +197,7 @@ Item {
196 }
197 }
197 }
198 }
198
199
200+ opacity: 1 - overviewController.progress
199 scale: 1 - overviewController.progress * 0.6
201 scale: 1 - overviewController.progress * 0.6
200 Behavior on scale {
202 Behavior on scale {
201 id: dashContentScaleAnimation
203 id: dashContentScaleAnimation
qml/Dash/ScopesOverview.qml+59−1
@@ -23,6 +23,7 @@ Item {
23
23
24 property real progress: 0
24 property real progress: 0
25 property var scope: null
25 property var scope: null
26+ property real scopeScale: 1
26
27
27 signal done
28 signal done
28
29
@@ -135,6 +136,48 @@ Item {
135 id: middleItems
136 id: middleItems
136 model: scope ? scope.categories : null
137 model: scope ? scope.categories : null
137 delegate: Loader {
138 delegate: Loader {
139+ height: {
140+ if (index == 0) {
141+ return parent.height;
142+ } else {
143+ return parent.height - topBar.height - units.gu(2)
144+ }
145+ }
146+ width: {
147+ if (index == 0) {
148+ return parent.width / scopeScale
149+ } else {
150+ return parent.width
151+ }
152+ }
153+ x: {
154+ if (index == 0) {
155+ return (root.width - width) / 2;
156+ } else {
157+ return 0;
158+ }
159+ }
160+ anchors {
161+ bottom: parent.bottom
162+ }
163+
164+ scale: index == 0 ? scopeScale : 1
165+
166+ opacity: tabBarHolder.currentTab == index ? 1 : 0
167+ Behavior on opacity { UbuntuNumberAnimation { } }
168+ enabled: opacity == 1
169+
170+ clip: index == 1
171+
172+ CardTool {
173+ id: cardTool
174+ objectName: "cardTool"
175+ count: results.count
176+ template: model.renderer
177+ components: model.components
178+ viewWidth: parent.width
179+ }
180+
138 source: {
181 source: {
139 if (index == 0) return "ScopesOverviewFavourites.qml";
182 if (index == 0) return "ScopesOverviewFavourites.qml";
140 else if (index == 1) return "ScopesOverviewAll.qml";
183 else if (index == 1) return "ScopesOverviewAll.qml";
@@ -143,6 +186,17 @@ Item {
143 return "";
186 return "";
144 }
187 }
145 }
188 }
189+
190+ onLoaded: {
191+ item.model = Qt.binding(function() { return results })
192+ item.cardTool = cardTool;
193+ if (index == 0) {
194+ item.scopeWidth = root.width;
195+ item.scopeHeight = root.height;
196+ } else if (index == 1) {
197+ item.extraHeight = bottomBar.height;
198+ }
199+ }
146 }
200 }
147 }
201 }
148
202
@@ -151,6 +205,7 @@ Item {
151 color: "black"
205 color: "black"
152 height: units.gu(6)
206 height: units.gu(6)
153 width: parent.width
207 width: parent.width
208+ opacity: 0.4
154 y: {
209 y: {
155 if (root.progress < 0.5) {
210 if (root.progress < 0.5) {
156 return parent.height;
211 return parent.height;
@@ -180,7 +235,10 @@ Item {
180 text: i18n.tr("Done")
235 text: i18n.tr("Done")
181 color: parent.pressed ? "black" : "white"
236 color: parent.pressed ? "black" : "white"
182 }
237 }
183− onClicked: root.done()
238+ onClicked: {
239+ root.done();
240+ tabBarHolder.currentTab = 0;
241+ }
184 }
242 }
185 }
243 }
186}
244}
tests/mocks/Unity/fake_scopes.cpp+7−1
@@ -27,6 +27,7 @@
27
27
28Scopes::Scopes(QObject *parent)
28Scopes::Scopes(QObject *parent)
29 : unity::shell::scopes::ScopesInterface(parent)
29 : unity::shell::scopes::ScopesInterface(parent)
30+ , m_scopesOverview(nullptr)
30 , m_loaded(false)
31 , m_loaded(false)
31 , timer(this)
32 , timer(this)
32{
33{
@@ -47,7 +48,10 @@ void Scopes::updateScopes()
47 addScope(new Scope("MockScope2", "Music", false, this));
48 addScope(new Scope("MockScope2", "Music", false, this));
48 addScope(new Scope("clickscope", "Apps", true, this));
49 addScope(new Scope("clickscope", "Apps", true, this));
49 addScope(new Scope("MockScope5", "Videos", true, this));
50 addScope(new Scope("MockScope5", "Videos", true, this));
51+ addScope(new Scope("MockScope3", "MS3", false, this));
52+ addScope(new Scope("MockScope4", "MS4", false, this));
53+ addScope(new Scope("MockScope6", "MS6", false, this));
50− addScope(new ScopesOverview(this));
54+ m_scopesOverview = new ScopesOverview(this);
51
55
52 if (!m_loaded) {
56 if (!m_loaded) {
53 m_loaded = true;
57 m_loaded = true;
@@ -64,6 +68,7 @@ void Scopes::clear()
64 m_scopes.clear();
68 m_scopes.clear();
65 endRemoveRows();
69 endRemoveRows();
66 }
70 }
71+ delete m_scopesOverview;
67
72
68 if (m_loaded) {
73 if (m_loaded) {
69 m_loaded = false;
74 m_loaded = false;
@@ -113,6 +118,7 @@ unity::shell::scopes::ScopeInterface* Scopes::getScope(int row) const
113
118
114unity::shell::scopes::ScopeInterface* Scopes::getScope(QString const &scope_id) const
119unity::shell::scopes::ScopeInterface* Scopes::getScope(QString const &scope_id) const
115{
120{
121+ if (scope_id == "scopesOverview") return m_scopesOverview;
116 for (Scope *scope : m_scopes) {
122 for (Scope *scope : m_scopes) {
117 if (scope->id() == scope_id)
123 if (scope->id() == scope_id)
118 return scope;
124 return scope;
tests/mocks/Unity/fake_scopes.h+1
@@ -59,6 +59,7 @@ private Q_SLOTS:
59
59
60private:
60private:
61 QList<Scope*> m_scopes;
61 QList<Scope*> m_scopes;
62+ Scope *m_scopesOverview;
62 bool m_loaded;
63 bool m_loaded;
63 QTimer timer;
64 QTimer timer;
64};
65};
tests/mocks/Unity/fake_scopesoverview.cpp+2−2
@@ -75,14 +75,14 @@ ScopesOverviewCategories::data(const QModelIndex& index, int role) const
75 {
75 {
76 QVariantMap map;
76 QVariantMap map;
77 map["category-layout"] = "grid";
77 map["category-layout"] = "grid";
78− map["card-size"] = "medium";
78+ map["card-size"] = "small";
79 map["overlay"] = true;
79 map["overlay"] = true;
80 return map;
80 return map;
81 }
81 }
82 case RoleComponents:
82 case RoleComponents:
83 {
83 {
84 QVariantMap map, artMap;
84 QVariantMap map, artMap;
85− artMap["aspect-ratio"] = "1.0";
85+ artMap["aspect-ratio"] = "0.5";
86 artMap["field"] = "art";
86 artMap["field"] = "art";
87 map["art"] = artMap;
87 map["art"] = artMap;
88 map["title"] = "HOLA";
88 map["title"] = "HOLA";