@@ -121,11 +121,14 @@ FocusScope {
122 actions: [
122 actions: [
124+ text: i18n.tr("Apps")
124− text: i18n.ctr("Apps sorted alphabetically", "A-Z")
127+ text: i18n.ctr("Apps sorted and grouped alphabetically", "A-Z")
125 // TODO: Disabling this for now as we don't get the right input from u-a-l yet.
128 // TODO: Disabling this for now as we don't get the right input from u-a-l yet.
127−// Action {
130+ // Action {
128−// text: i18n.ctr("Most used apps", "Most used")
131+ // text: i18n.ctr("Most used apps", "Most used")
@@ -179,8 +182,8 @@ FocusScope {
180 sourceComponent: {
183 sourceComponent: {
181 switch (sections.selectedIndex) {
184 switch (sections.selectedIndex) {
182− case 0: return aToZComponent;
185+ case 0: return singleGroupComponent;
183− case 1: return mostUsedComponent;
186+ case 1: return aToZComponent;
186 Binding {
189 Binding {
@@ -225,49 +228,42 @@ FocusScope {
227 Component {
230 Component {
228− id: mostUsedComponent
231+ id: singleGroupComponent
229 DrawerListView {
232 DrawerListView {
230− id: mostUsedListView
233+ id: singleGroupListView
232− header: MoreAppsHeader {
235− highlighted: headerFocusScope.activeFocus
236− onClicked: headerFocusScope.trigger();
239− model: AppDrawerProxyModel {
235+ model: ListModel {
240− source: sortProxyModel
236+ id: singleGroupModel
241− group: AppDrawerProxyModel.GroupByAll
237+ Component.onCompleted: {
242− sortBy: AppDrawerProxyModel.SortByUsage
238+ append({"name": i18n.tr("Apps")});
243− dynamicSortFilter: false
239+ }
246− delegate: UbuntuShape {
242+ delegate: Item {
247 width: parent.width - units.gu(2)
243 width: parent.width - units.gu(2)
248 anchors.horizontalCenter: parent.horizontalCenter
244 anchors.horizontalCenter: parent.horizontalCenter
250− aspect: UbuntuShape.Flat
251− // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
252− // which messes up the ListView.
253− height: (Math.ceil(mostUsedGridView.model.count / mostUsedGridView.columns) * mostUsedGridView.delegateHeight) + units.gu(2)
255 readonly property string appId: model.appId
246 readonly property string appId: model.appId
257− DrawerGridView {
248+ // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
258− id: mostUsedGridView
249+ // which messes up the ListView.
259− anchors.fill: parent
250+ height: (Math.ceil(gridView.model.count / gridView.columns) * gridView.delegateHeight) + units.gu(2)
260− topMargin: units.gu(1)
261− bottomMargin: units.gu(1)
264− interactive: true
252+ DrawerGridView {
265− focus: index == mostUsedListView.currentIndex
253+ id: gridView
254+ anchors { left: parent.left; top: parent.top; right: parent.right; topMargin: units.gu(1) }
255+ height: rows * delegateHeight
267− model: sortProxyModel
257+ interactive: false
258+ focus: index == aToZListView.currentIndex
260+ model: AppDrawerProxyModel {
262+ source: sortProxyModel
263+ dynamicSortFilter: false
269 delegateWidth: root.delegateWidth
265 delegateWidth: root.delegateWidth
270− delegateHeight: units.gu(10)
266+ delegateHeight: units.gu(11)
271 delegate: drawerDelegateComponent
267 delegate: drawerDelegateComponent
@@ -279,13 +275,6 @@ FocusScope {
279 DrawerListView {
275 DrawerListView {
280 id: aToZListView
276 id: aToZListView
282− header: MoreAppsHeader {
285− highlighted: headerFocusScope.activeFocus
286− onClicked: headerFocusScope.trigger();
289 model: AppDrawerProxyModel {
278 model: AppDrawerProxyModel {
290 source: sortProxyModel
279 source: sortProxyModel
291 sortBy: AppDrawerProxyModel.SortByAToZ
280 sortBy: AppDrawerProxyModel.SortByAToZ
@@ -327,7 +316,7 @@ FocusScope {
327 dynamicSortFilter: false
316 dynamicSortFilter: false
329 delegateWidth: root.delegateWidth
318 delegateWidth: root.delegateWidth
330− delegateHeight: units.gu(10)
319+ delegateHeight: units.gu(11)
331 delegate: drawerDelegateComponent
320 delegate: drawerDelegateComponent
@@ -340,7 +329,7 @@ FocusScope {
340 AbstractButton {
329 AbstractButton {
341 id: drawerDelegate
330 id: drawerDelegate
342 width: GridView.view.cellWidth
331 width: GridView.view.cellWidth
343− height: units.gu(10)
332+ height: units.gu(11)
344 objectName: "drawerItem_" + model.appId
333 objectName: "drawerItem_" + model.appId
346 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
335 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
@@ -349,7 +338,7 @@ FocusScope {
349 z: loader.active ? 1 : 0
338 z: loader.active ? 1 : 0
352− width: units.gu(8)
341+ width: units.gu(9)
353 anchors.horizontalCenter: parent.horizontalCenter
342 anchors.horizontalCenter: parent.horizontalCenter
354 height: childrenRect.height
343 height: childrenRect.height
355 spacing: units.gu(1)
344 spacing: units.gu(1)
@@ -382,8 +371,11 @@ FocusScope {
382 id: label
371 id: label
383 text: model.name
372 text: model.name
384 width: parent.width
373 width: parent.width
374+ anchors.horizontalCenter: parent.horizontalCenter
385 horizontalAlignment: Text.AlignHCenter
375 horizontalAlignment: Text.AlignHCenter
386 fontSize: "small"
376 fontSize: "small"
377+ wrapMode: Text.WordWrap
387 elide: Text.ElideRight
379 elide: Text.ElideRight