on xenial help sign in
Make gradients not break FilterGrid.
bab628fMichał Karnicki
qml/Dash/DashRenderer.qml+34
@@ -62,4 +62,38 @@ Item {
62
62
63 function startFilterAnimation(filter) {
63 function startFilterAnimation(filter) {
64 }
64 }
65+
66+ /// Whether this is the first item in the list
67+ property bool firstItem: false
68+
69+ /// Whether this is the last item in the list
70+ property bool lastItem: false
71+
72+ Component.onCompleted: console.log(firstItem, lastItem)
73+ onFirstItemChanged: console.log(firstItem, lastItem)
74+ onLastItemChanged: console.log(firstItem, lastItem)
75+
76+ Image {
77+ visible: !firstItem
78+ anchors {
79+ top: parent.top
80+ left: parent.left
81+ right: parent.right
82+ }
83+ fillMode: Image.Stretch
84+ source: "graphics/dash_divider_top_lightgrad.png"
85+ z: -1
86+ }
87+
88+ Image {
89+ visible: !lastItem
90+ anchors {
91+ bottom: parent.bottom
92+ left: parent.left
93+ right: parent.right
94+ }
95+ fillMode: Image.Stretch
96+ source: "graphics/dash_divider_top_darkgrad.png"
97+ z: -1
98+ }
65}
99}
qml/Dash/GenericScopeView.qml+3−27
@@ -143,20 +143,6 @@ FocusScope {
143 readonly property string category: categoryId
143 readonly property string category: categoryId
144 readonly property var item: rendererLoader.item
144 readonly property var item: rendererLoader.item
145
145
146− Image {
147− id: bottomGradient
148− visible: index == list.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 {
146 Loader {
161 id: rendererLoader
147 id: rendererLoader
162 anchors {
148 anchors {
@@ -168,6 +154,9 @@ FocusScope {
168 source: getRenderer(model.renderer, model.contentType, model.rendererHint, results)
154 source: getRenderer(model.renderer, model.contentType, model.rendererHint, results)
169
155
170 onLoaded: {
156 onLoaded: {
157+ item.firstItem = Qt.binding(function() { return index === 0 });
158+ // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
159+ item.lastItem = Qt.binding(function() { return index === categoryView.model.count - 1 });
171 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
160 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
172 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
161 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
173 scopeView.enableHeightBehaviorOnNextCreation = false;
162 scopeView.enableHeightBehaviorOnNextCreation = false;
@@ -316,19 +305,6 @@ FocusScope {
316 else
305 else
317 categoryView.expandedCategoryId = "";
306 categoryView.expandedCategoryId = "";
318 }
307 }
319−
320− Image {
321− id: topGradient
322− anchors {
323− top: parent.top
324− left: parent.left
325− right: parent.right
326− }
327− fillMode: Image.Stretch
328− verticalAlignment: Image.AlignTop
329− source: "graphics/dash_divider_top_lightgrad.png"
330− z: -1
331− }
332 }
308 }
333 pageHeader: Item {
309 pageHeader: Item {
334 implicitHeight: scopeView.tabBarHeight
310 implicitHeight: scopeView.tabBarHeight