on xenial help sign in
Merge fix in lp:~unity-team/unity8/unity8-category-gradients.
b9347b5Michał Sawicz
qml/Dash/DashRenderer.qml+34
@@ -68,4 +68,38 @@ Item {
68
68
69 /// Component mapping and configuration from the scope
69 /// Component mapping and configuration from the scope
70 property var components
70 property var components
71+
72+ /// Whether this is the first item in the list
73+ property bool firstItem: false
74+
75+ /// Whether this is the last item in the list
76+ property bool lastItem: false
77+
78+ Component.onCompleted: console.log(firstItem, lastItem)
79+ onFirstItemChanged: console.log(firstItem, lastItem)
80+ onLastItemChanged: console.log(firstItem, lastItem)
81+
82+ Image {
83+ visible: !firstItem
84+ anchors {
85+ top: parent.top
86+ left: parent.left
87+ right: parent.right
88+ }
89+ fillMode: Image.Stretch
90+ source: "graphics/dash_divider_top_lightgrad.png"
91+ z: -1
92+ }
93+
94+ Image {
95+ visible: !lastItem
96+ anchors {
97+ bottom: parent.bottom
98+ left: parent.left
99+ right: parent.right
100+ }
101+ fillMode: Image.Stretch
102+ source: "graphics/dash_divider_top_darkgrad.png"
103+ z: -1
104+ }
71}
105}
qml/Dash/GenericScopeView.qml+3−28
@@ -142,21 +142,6 @@ FocusScope {
142 readonly property string category: categoryId
142 readonly property string category: categoryId
143 readonly property var item: rendererLoader.item
143 readonly property var item: rendererLoader.item
144
144
145− Image {
146− id: bottomGradient
147− // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
148− visible: index !== categoryView.model.count - 1
149− anchors {
150− bottom: parent.bottom
151− left: parent.left
152− right: parent.right
153− }
154− fillMode: Image.Stretch
155− verticalAlignment: Image.AlignBottom
156− source: "graphics/dash_divider_top_darkgrad.png"
157− z: -1
158− }
159−
160 Loader {
145 Loader {
161 id: rendererLoader
146 id: rendererLoader
162 anchors {
147 anchors {
@@ -168,6 +153,9 @@ FocusScope {
168 source: getRenderer(model.renderer, results)
153 source: getRenderer(model.renderer, results)
169
154
170 onLoaded: {
155 onLoaded: {
156+ item.firstItem = Qt.binding(function() { return index === 0 });
157+ // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
158+ item.lastItem = Qt.binding(function() { return index === categoryView.model.count - 1 });
171 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
159 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
172 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
160 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
173 scopeView.enableHeightBehaviorOnNextCreation = false;
161 scopeView.enableHeightBehaviorOnNextCreation = false;
@@ -302,19 +290,6 @@ FocusScope {
302 else
290 else
303 categoryView.expandedCategoryId = "";
291 categoryView.expandedCategoryId = "";
304 }
292 }
305−
306− Image {
307− id: topGradient
308− anchors {
309− top: parent.top
310− left: parent.left
311− right: parent.right
312− }
313− fillMode: Image.Stretch
314− verticalAlignment: Image.AlignTop
315− source: "graphics/dash_divider_top_lightgrad.png"
316− z: -1
317− }
318 }
293 }
319 pageHeader: Item {
294 pageHeader: Item {
320 implicitHeight: scopeView.tabBarHeight
295 implicitHeight: scopeView.tabBarHeight