@@ -0,0 +1,213 @@
2+import Ubuntu.Components 1.3
3+import Unity.Launcher 0.1
11+ property int panelWidth: 0
12+ readonly property bool moving: listLoader.item && listLoader.item.moving
14+ signal applicationSelected(string appId)
20+ AppDrawerProxyModel {
22+ source: appDrawerModel
23+ filterString: searchField.text
29+ anchors.leftMargin: root.panelWidth
33+ anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
34+ placeholderText: i18n.tr("Search...")
38+ id: sectionsContainer
39+ anchors { left: parent.left; top: searchField.bottom; right: parent.right; }
40+ height: sections.height
57+ anchors.bottom: parent.bottom
60+ width: contentContainer.width
67+ anchors { left: parent.left; top: sectionsContainer.bottom; right: parent.right; bottom: parent.bottom; leftMargin: units.gu(1); rightMargin: units.gu(1) }
68+ sourceComponent: sections.selectedIndex == 0 ? aToZComponent : mostUsedComponent
72+ id: mostUsedComponent
75+ topMargin: units.gu(1)
76+ bottomMargin: units.gu(1)
80+ header: MoreAppsHeader {
85+ model: AppDrawerProxyModel {
86+ source: sortProxyModel
87+ group: AppDrawerProxyModel.GroupByAll
90+ delegate: UbuntuShape {
93+ aspect: UbuntuShape.Flat
94+ // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
95+ // which messes up the ListView.
96+ height: (Math.ceil(mostUsedGridView.model.count / mostUsedGridView.columns) * mostUsedGridView.delegateHeight) + units.gu(2)
100+ anchors.fill: parent
101+ topMargin: units.gu(1)
102+ bottomMargin: units.gu(1)
105+ model: sortProxyModel
108+ delegateWidth: units.gu(8)
109+ delegateHeight: units.gu(10)
110+ delegate: drawerDelegateComponent
119+ anchors.fill: parent
120+ topMargin: units.gu(1)
121+ bottomMargin: units.gu(1)
122+ spacing: units.gu(1)
125+ header: MoreAppsHeader {
130+ model: AppDrawerProxyModel {
131+ source: sortProxyModel
132+ group: AppDrawerProxyModel.GroupByAToZ
135+ delegate: UbuntuShape {
138+ aspect: UbuntuShape.Flat
140+ // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
141+ // which messes up the ListView.
142+ height: (Math.ceil(gridView.model.count / gridView.columns) * gridView.delegateHeight) +
143+ categoryNameLabel.implicitHeight + units.gu(2)
146+ id: categoryNameLabel
147+ anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
153+ anchors { left: parent.left; top: categoryNameLabel.bottom; right: parent.right; topMargin: units.gu(1) }
154+ height: rows * delegateHeight
158+ model: AppDrawerProxyModel {
160+ source: sortProxyModel
161+ filterLetter: model.letter
163+ delegateWidth: units.gu(8)
164+ delegateHeight: units.gu(10)
165+ delegate: drawerDelegateComponent
173+ id: drawerDelegateComponent
175+ width: GridView.view.cellWidth
176+ height: units.gu(10)
178+ onClicked: root.applicationSelected(model.appId)
182+ anchors.horizontalCenter: parent.horizontalCenter
183+ height: childrenRect.height
184+ spacing: units.gu(1)
189+ height: 7.5 / 8 * width
190+ anchors.horizontalCenter: parent.horizontalCenter
191+ backgroundMode: UbuntuShape.SolidColor
192+ backgroundColor: UbuntuColors.lightGrey
194+ borderSource: 'undefined'
197+ sourceSize.width: appIcon.width
200+ sourceFillMode: UbuntuShape.PreserveAspectCrop
206+ horizontalAlignment: Text.AlignHCenter
208+ elide: Text.ElideRight