@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
19import Ubuntu.Components.ListItems 0.1 as ListItems
19import Ubuntu.Components.ListItems 0.1 as ListItems
20import Unity 0.1
20import Unity 0.1
21import Unity.Launcher 0.1
21import Unity.Launcher 0.1
22+import Ubuntu.Components.Popups 0.1
22import "../Components/ListItems"
23import "../Components/ListItems"
@@ -29,7 +30,8 @@ Item {
29 property var model
30 property var model
30 property bool inverted: true
31 property bool inverted: true
31 property bool dragging: false
32 property bool dragging: false
32− property bool moving: launcherListView.moving || launcherListView.flicking || dndArea.draggedIndex >= 0
33+ property bool moving: launcherListView.moving || launcherListView.flicking
34+ property bool preventHiding: moving || dndArea.draggedIndex >= 0 || dndArea.quickListPopover !== null || dndArea.pressed
33 property int highlightIndex: -1
35 property int highlightIndex: -1
35 signal applicationSelected(string desktopFile)
37 signal applicationSelected(string desktopFile)
@@ -219,6 +221,7 @@ Item {
220 MouseArea {
222 MouseArea {
221 id: dndArea
223 id: dndArea
224+ objectName: "dndArea"
222 anchors {
225 anchors {
223 fill: parent
226 fill: parent
224 topMargin: launcherListView.topMargin
227 topMargin: launcherListView.topMargin
@@ -234,6 +237,7 @@ Item {
234 property bool postDragging: false
237 property bool postDragging: false
235 property int startX
238 property int startX
236 property int startY
239 property int startY
240+ property var quickListPopover: null
238 onPressed: {
242 onPressed: {
239 selectedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
243 selectedItem = launcherListView.itemAt(mouseX, mouseY + launcherListView.realContentY)
@@ -302,6 +306,13 @@ Item {
303 draggedIndex = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
307 draggedIndex = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
309+ // Opening QuickList
310+ var quickListModel = launcherListView.model.get(draggedIndex).quickList
311+ var quickListAppId = launcherListView.model.get(draggedIndex).appId
313+ quickListPopover = PopupUtils.open(popoverComponent, selectedItem,
314+ {model: quickListModel, appId: quickListAppId})
305 launcherListView.interactive = false
316 launcherListView.interactive = false
307 var yOffset = draggedIndex > 0 ? (mouseY + launcherListView.realContentY) % (draggedIndex * launcherListView.realItemHeight) : mouseY + launcherListView.realContentY
318 var yOffset = draggedIndex > 0 ? (mouseY + launcherListView.realContentY) % (draggedIndex * launcherListView.realItemHeight) : mouseY + launcherListView.realContentY
@@ -324,6 +335,7 @@ Item {
324 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
335 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
325 if (!preDragging && distance > units.gu(1.5)) {
336 if (!preDragging && distance > units.gu(1.5)) {
326 preDragging = true;
337 preDragging = true;
338+ PopupUtils.close(quickListPopover)
328 if (distance > launcherListView.itemHeight) {
340 if (distance > launcherListView.itemHeight) {
329 selectedItem.dragging = true
341 selectedItem.dragging = true
@@ -414,4 +426,46 @@ Item {
431+ id: popoverComponent
436+ property string appId
437+ contentWidth: quickListColumn.width
439+ // FIXME: There's a bug in the Popover positioning that it covers the item in case it is rotated.
440+ // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1204470
441+ // For now, let's move the Popover around with callerMargin.
442+ // Remove popupMargin once the bug is fixed.
443+ property int popupMargin: root.inverted ? launcherListView.itemHeight : 0;
445+ callerMargin: units.gu(1) + popupMargin
450+ height: childrenRect.height
453+ model: popover.model
455+ ListItems.Standard {
456+ objectName: "quickListEntry" + index
457+ text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
458+ highlightWhenPressed: model.clickable
460+ if (!model.clickable) {
463+ LauncherModel.quickListActionInvoked(appId, index);
464+ PopupUtils.close(popover);