@@ -19,14 +19,13 @@ import Unity 0.1
1919
2020import "../../../../Dash"
2121
22−ScopeView {
22+GenericScopeView {
2323 id: fakeScopeView
2424
2525 property alias backColor : back.color
26− moving: listView.moving
2726
2827 onEndReached: {
29− if (shell != undefined && shell.scopeStatus != undefined) {
28+ if (scope != undefined && shell != undefined && shell.scopeStatus != undefined) {
3029 shell.scopeStatus[scope.id].endReached++;
3130 }
3231 }
@@ -45,71 +44,6 @@ ScopeView {
4544 id: back
4645 anchors.fill: parent
4746 color: "grey"
48− }
49−
50− function randomBg()
51− {
52− var hex1=new Array("4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
53− var bg="#"+hex1[Math.floor(Math.random()*hex1.length)]+
54− hex1[Math.floor(Math.random()*hex1.length)]+
55− hex1[Math.floor(Math.random()*hex1.length)]+
56− hex1[Math.floor(Math.random()*hex1.length)]+
57− hex1[Math.floor(Math.random()*hex1.length)]+
58− hex1[Math.floor(Math.random()*hex1.length)]
59− return bg
60− }
61−
62−
63− ListView {
64− id: listView
65− anchors.fill: parent
66− model: scope ? scope.categories : null
67− orientation: ListView.Vertical
68−
69− delegate: Column {
70− id: column
71− width: listView.width
72− height: childrenRect.height
73−
74− Rectangle {
75− width: listView.width
76− height: units.gu(3)
77− color: randomBg()
78−
79− Text {
80− text: name
81− font.family: "Ubuntu"
82− font.weight: Font.Bold
83− font.pixelSize: 20
84− anchors.horizontalCenter: parent.horizontalCenter
85− }
86− }
87− GridView {
88− id: resultsGrid
89− model: results
90− cellWidth: units.gu(10); cellHeight: units.gu(10)
91− height: childrenRect.height
92− width: listView.width
93− interactive: false
94−
95− delegate: Component {
96− id: resultDelegate
97− Item {
98− width: resultsGrid.cellWidth; height: resultsGrid.cellHeight
99− Column {
100− anchors.verticalCenter: parent.verticalCenter
101− anchors.horizontalCenter: parent.horizontalCenter
102− Image {
103− width: units.gu(5)
104− height: units.gu(5)
105− source: icon
106− anchors.horizontalCenter: parent.horizontalCenter
107− }
108− Text { text: title; anchors.horizontalCenter: parent.horizontalCenter }
109− }
110− }
111− }
112− }
113− }
47+ z: -1
11448 }
11549}