@@ -31,32 +31,11 @@ Item {
31 property bool inverted: false
31 property bool inverted: false
32 property bool dragging: false
32 property bool dragging: false
33 property bool moving: launcherListView.moving || launcherListView.flicking || dndArea.draggedItem !== undefined
33 property bool moving: launcherListView.moving || launcherListView.flicking || dndArea.draggedItem !== undefined
34− property int dragPosition: 0
35 property int highlightIndex: -1
34 property int highlightIndex: -1
37 signal applicationSelected(string desktopFile)
36 signal applicationSelected(string desktopFile)
38 signal dashItemSelected(int index)
37 signal dashItemSelected(int index)
40− onDragPositionChanged: {
41− var effectiveDragPosition = root.inverted ? launcherListView.height - dragPosition : dragPosition - mainColumn.anchors.margins
43− var hiddenContentHeight = launcherListView.contentHeight - launcherListView.height
44− // Shortening scrollable height because the first/last item needs to be fully expanded before reaching the top/bottom
45− var scrollableHeight = launcherListView.height - (launcherListView.itemSize + launcherListView.spacing) *2
46− // As we shortened the scrollableHeight, lets move everything down by the itemSize
47− var shortenedEffectiveDragPosition = effectiveDragPosition - launcherListView.itemSize - launcherListView.spacing
48− var newContentY = shortenedEffectiveDragPosition * hiddenContentHeight / scrollableHeight
50− // limit top/bottom to prevent overshooting
51− launcherListView.contentY = Math.min(hiddenContentHeight, Math.max(0, newContentY));
53− // Now calculate the current index:
54− // > the current mouse position + the hidden/scolled content on top is the mouse position in the averall view
55− // > adjust that removing all the margins
56− // > divide by itemSize to get index
57−// highlightIndex = (effectiveDragPosition + launcherListView.contentY - mainColumn.anchors.margins*3 - launcherListView.spacing/2) / (launcherListView.itemSize + launcherColumn.spacing)
60 BorderImage {
39 BorderImage {
61 id: background
40 id: background
62 source: "graphics/launcher_bg.sci"
41 source: "graphics/launcher_bg.sci"