@@ -451,6 +451,7 @@ FocusScope {
451451 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
452452 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
453453 PropertyChanges { target: wallpaper; visible: false }
454+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
454455 },
455456 State {
456457 name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "staged"
@@ -499,11 +500,13 @@ FocusScope {
499500 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
500501 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
501502 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
503+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
502504 },
503505 Transition {
504506 to: "spread"
505507 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
506508 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
509+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
507510 },
508511 Transition {
509512 from: "spread"
@@ -565,6 +568,8 @@ FocusScope {
565568 anchors { left: parent.left; top: parent.top; right: parent.right }
566569 height: parent.height / 3
567570 background: root.background
571+ opacity: 0
572+ visible: opacity > 0
568573 }
569574
570575 Spread {
@@ -579,6 +584,83 @@ FocusScope {
579584 onLeaveSpread: {
580585 priv.goneToSpread = false;
581586 }
587+
588+ FloatingFlickable {
589+ id: floatingFlickable
590+ objectName: "spreadFlickable"
591+ anchors.fill: parent
592+ enabled: false
593+ contentWidth: spreadItem.spreadTotalWidth
594+
595+ function snap(toIndex) {
596+ var delegate = appRepeater.itemAt(toIndex)
597+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
598+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
599+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
600+ snapAnimation.to = floatingFlickable.contentX - offset;
601+ snapAnimation.start();
602+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
603+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
604+ snapAnimation.to = floatingFlickable.contentX - offset;
605+ snapAnimation.start();
606+ }
607+ }
608+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
609+ }
610+
611+ MouseArea {
612+ id: hoverMouseArea
613+ objectName: "hoverMouseArea"
614+ anchors.fill: parent
615+ propagateComposedEvents: true
616+ hoverEnabled: true
617+ enabled: false
618+ visible: enabled
619+
620+ property int scrollAreaWidth: width / 3
621+ property bool progressiveScrollingEnabled: false
622+
623+ onMouseXChanged: {
624+ mouse.accepted = false
625+
626+ if (hoverMouseArea.pressed) {
627+ return;
628+ }
629+
630+ // Find the hovered item and mark it active
631+ for (var i = appRepeater.count - 1; i >= 0; i--) {
632+ var appDelegate = appRepeater.itemAt(i);
633+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
634+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
635+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
636+ spreadItem.highlightedIndex = i;
637+ break;
638+ }
639+ }
640+
641+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
642+ var margins = floatingFlickable.width * 0.05;
643+
644+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
645+ progressiveScrollingEnabled = true
646+ }
647+
648+ // do we need to scroll?
649+ if (mouseX < scrollAreaWidth + margins) {
650+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
651+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
652+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
653+ }
654+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
655+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
656+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
657+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
658+ }
659+ }
660+ }
661+
662+ onPressed: mouse.accepted = false
663+ }
582664 }
583665
584666 Connections {
@@ -1750,83 +1832,6 @@ FocusScope {
17501832 }
17511833 }
17521834
1753− MouseArea {
1754− id: hoverMouseArea
1755− objectName: "hoverMouseArea"
1756− anchors.fill: appContainer
1757− propagateComposedEvents: true
1758− hoverEnabled: true
1759− enabled: false
1760− visible: enabled
1761−
1762− property int scrollAreaWidth: width / 3
1763− property bool progressiveScrollingEnabled: false
1764−
1765− onMouseXChanged: {
1766− mouse.accepted = false
1767−
1768− if (hoverMouseArea.pressed) {
1769− return;
1770− }
1771−
1772− // Find the hovered item and mark it active
1773− for (var i = appRepeater.count - 1; i >= 0; i--) {
1774− var appDelegate = appRepeater.itemAt(i);
1775− var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1776− var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1777− if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1778− spreadItem.highlightedIndex = i;
1779− break;
1780− }
1781− }
1782−
1783− if (floatingFlickable.contentWidth > floatingFlickable.width) {
1784− var margins = floatingFlickable.width * 0.05;
1785−
1786− if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1787− progressiveScrollingEnabled = true
1788− }
1789−
1790− // do we need to scroll?
1791− if (mouseX < scrollAreaWidth + margins) {
1792− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1793− var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1794− floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1795− }
1796− if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1797− var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1798− var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1799− floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1800− }
1801− }
1802− }
1803−
1804− onPressed: mouse.accepted = false
1805− }
1806−
1807− FloatingFlickable {
1808− id: floatingFlickable
1809− objectName: "spreadFlickable"
1810− anchors.fill: appContainer
1811− enabled: false
1812− contentWidth: spreadItem.spreadTotalWidth
1813−
1814− function snap(toIndex) {
1815− var delegate = appRepeater.itemAt(toIndex)
1816− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1817− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1818− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1819− snapAnimation.to = floatingFlickable.contentX - offset;
1820− snapAnimation.start();
1821− } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1822− var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1823− snapAnimation.to = floatingFlickable.contentX - offset;
1824− snapAnimation.start();
1825− }
1826− }
1827− UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
1828− }
1829−
18301835 PropertyAnimation {
18311836 id: shortRightEdgeSwipeAnimation
18321837 property: "x"