@@ -48,6 +48,9 @@ FocusScope {
48 property rect inputMethodRect
48 property rect inputMethodRect
49 property real rightEdgePushProgress: 0
49 property real rightEdgePushProgress: 0
50 property Item availableDesktopArea
50 property Item availableDesktopArea
51+ property PanelState panelState
53+ readonly property var temporarySelectedWorkspace: state == "spread" ? screensAndWorkspaces.lastClickedWorkspace : null
52 // Configuration
55 // Configuration
53 property string mode: "staged"
56 property string mode: "staged"
@@ -243,6 +246,25 @@ FocusScope {
250+ id: showWorkspaceSwitcherShortcutLeft
251+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Left
252+ active: !workspaceSwitcher.active
255+ workspaceSwitcher.showLeft()
259+ id: showWorkspaceSwitcherShortcutRight
260+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right
261+ active: !workspaceSwitcher.active
264+ workspaceSwitcher.showRight()
246 QtObject {
268 QtObject {
248 objectName: "DesktopStagePrivate"
270 objectName: "DesktopStagePrivate"
@@ -378,23 +400,23 @@ FocusScope {
378 readonly property real windowDecorationHeight: units.gu(3)
400 readonly property real windowDecorationHeight: units.gu(3)
381− Component.onCompleted: priv.updateMainAndSideStageIndexes();
403+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
383 Connections {
405 Connections {
384− target: PanelState
406+ target: panelState
385 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
407 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
386 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
408 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
387 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
409 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
390 Binding {
412 Binding {
391− target: PanelState
413+ target: panelState
392 property: "decorationsVisible"
414 property: "decorationsVisible"
393 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
415 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
396 Binding {
418 Binding {
397− target: PanelState
419+ target: panelState
398 property: "title"
420 property: "title"
400 if (priv.focusedAppDelegate !== null) {
422 if (priv.focusedAppDelegate !== null) {
@@ -409,7 +431,7 @@ FocusScope {
411 Binding {
433 Binding {
412− target: PanelState
434+ target: panelState
413 property: "focusedPersistentSurfaceId"
435 property: "focusedPersistentSurfaceId"
415 if (priv.focusedAppDelegate !== null) {
437 if (priv.focusedAppDelegate !== null) {
@@ -423,21 +445,21 @@ FocusScope {
425 Binding {
447 Binding {
426− target: PanelState
448+ target: panelState
427 property: "dropShadow"
449 property: "dropShadow"
428 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
450 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
431 Binding {
453 Binding {
432− target: PanelState
454+ target: panelState
433 property: "closeButtonShown"
455 property: "closeButtonShown"
434 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
456 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
437 Component.onDestruction: {
459 Component.onDestruction: {
438− PanelState.title = "";
460+ panelState.title = "";
439− PanelState.decorationsVisible = false;
461+ panelState.decorationsVisible = false;
440− PanelState.dropShadow = false;
462+ panelState.dropShadow = false;
443 Instantiator {
465 Instantiator {
@@ -483,6 +505,7 @@ FocusScope {
483 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
505 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
484 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
506 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
485 PropertyChanges { target: wallpaper; visible: false }
507 PropertyChanges { target: wallpaper; visible: false }
508+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
488 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
511 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -530,11 +553,18 @@ FocusScope {
530 Transition {
553 Transition {
531 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
554 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
532 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
555 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
556+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
557+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
533 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
558 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
559+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
535 Transition {
561 Transition {
536 to: "spread"
562 to: "spread"
563+ PropertyAction { target: screensAndWorkspaces; property: "activeWorkspace"; value: WMScreen.currentWorkspace }
564+ ScriptAction { script: { print("blabal***********************", WMScreen.currentWorkspace) } }
537 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
565 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
566+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
567+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
539 Transition {
569 Transition {
540 from: "spread"
570 from: "spread"
@@ -550,6 +580,7 @@ FocusScope {
551 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
581 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
552 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
582 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
583+ PropertyAction { target: screensAndWorkspaces; property: "lastClickedWorkspace"; value: null }
555 Transition {
586 Transition {
@@ -592,10 +623,21 @@ FocusScope {
592 visible: false
623 visible: false
626+ ScreensAndWorkspaces {
627+ id: screensAndWorkspaces
628+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
629+ height: Math.max(units.gu(30), parent.height * .3)
630+ background: root.background
632+ visible: opacity > 0
633+ onCloseSpread: priv.goneToSpread = false;
634+ onLastClickedWorkspaceChanged: activeWorkspace = lastClickedWorkspace
596 id: spreadItem
638 id: spreadItem
597 objectName: "spreadItem"
639 objectName: "spreadItem"
598− anchors.fill: appContainer
640+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
599 leftMargin: root.availableDesktopArea.x
641 leftMargin: root.availableDesktopArea.x
600 model: root.topLevelSurfaceList
642 model: root.topLevelSurfaceList
601 spreadFlickable: floatingFlickable
643 spreadFlickable: floatingFlickable
@@ -610,6 +652,83 @@ FocusScope {
610 appRepeater.itemAt(highlightedIndex).close();
652 appRepeater.itemAt(highlightedIndex).close();
657+ id: floatingFlickable
658+ objectName: "spreadFlickable"
659+ anchors.fill: parent
661+ contentWidth: spreadItem.spreadTotalWidth
663+ function snap(toIndex) {
664+ var delegate = appRepeater.itemAt(toIndex)
665+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
666+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
667+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
668+ snapAnimation.to = floatingFlickable.contentX - offset;
669+ snapAnimation.start();
670+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
671+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
672+ snapAnimation.to = floatingFlickable.contentX - offset;
673+ snapAnimation.start();
676+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
681+ objectName: "hoverMouseArea"
682+ anchors.fill: parent
683+ propagateComposedEvents: true
688+ property int scrollAreaWidth: width / 3
689+ property bool progressiveScrollingEnabled: false
691+ onPressed: mouse.accepted = false
694+ mouse.accepted = false
696+ if (hoverMouseArea.pressed) {
700+ // Find the hovered item and mark it active
701+ for (var i = appRepeater.count - 1; i >= 0; i--) {
702+ var appDelegate = appRepeater.itemAt(i);
703+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
704+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
705+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
706+ spreadItem.highlightedIndex = i;
711+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
712+ var margins = floatingFlickable.width * 0.05;
714+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
715+ progressiveScrollingEnabled = true
718+ // do we need to scroll?
719+ if (mouseX < scrollAreaWidth + margins) {
720+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
721+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
722+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
724+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
725+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
726+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
727+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
615 Connections {
734 Connections {
@@ -704,6 +823,24 @@ FocusScope {
828+ property real previewScale: .5
829+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
831+ width: implicitWidth * height / implicitHeight
834+ opacity: surface != null ? 1 : 0
835+ Behavior on opacity { UbuntuNumberAnimation {} }
836+ visible: opacity > 0
838+ Drag.active: surface != null
839+ Drag.keys: ["application"]
707 Repeater {
844 Repeater {
708 id: appRepeater
845 id: appRepeater
709 model: topLevelSurfaceList
846 model: topLevelSurfaceList
@@ -732,6 +869,9 @@ FocusScope {
733 z: normalZ
870 z: normalZ
872+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
873+ Behavior on opacity { UbuntuNumberAnimation {} }
735 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
875 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
736 // match what the actual surface size is.
876 // match what the actual surface size is.
737 // Don't write to those, they will be set by states
877 // Don't write to those, they will be set by states
@@ -912,7 +1052,6 @@ FocusScope {
912 function claimFocus() {
1052 function claimFocus() {
913 if (root.state == "spread") {
1053 if (root.state == "spread") {
914 spreadItem.highlightedIndex = index
1054 spreadItem.highlightedIndex = index
915− priv.goneToSpread = false;
917 if (root.mode == "stagedWithSideStage") {
1056 if (root.mode == "stagedWithSideStage") {
918 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1057 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1246,8 +1385,6 @@ FocusScope {
1246 y: spreadMaths.targetY
1385 y: spreadMaths.targetY
1247 z: index
1386 z: index
1248 height: spreadItem.spreadItemHeight
1387 height: spreadItem.spreadItemHeight
1249− requestedWidth: decoratedWindow.oldRequestedWidth
1250− requestedHeight: decoratedWindow.oldRequestedHeight
1251 visible: spreadMaths.itemVisible
1388 visible: spreadMaths.itemVisible
1253 PropertyChanges { target: dragArea; enabled: true }
1390 PropertyChanges { target: dragArea; enabled: true }
@@ -1267,8 +1404,6 @@ FocusScope {
1267 y: stagedRightEdgeMaths.animatedY
1404 y: stagedRightEdgeMaths.animatedY
1268 z: stagedRightEdgeMaths.animatedZ
1405 z: stagedRightEdgeMaths.animatedZ
1269 height: stagedRightEdgeMaths.animatedHeight
1406 height: stagedRightEdgeMaths.animatedHeight
1270− requestedWidth: decoratedWindow.oldRequestedWidth
1271− requestedHeight: decoratedWindow.oldRequestedHeight
1272 visible: appDelegate.x < root.width
1407 visible: appDelegate.x < root.width
1274 PropertyChanges {
1409 PropertyChanges {
@@ -1298,8 +1433,6 @@ FocusScope {
1298 y: windowedRightEdgeMaths.animatedY
1433 y: windowedRightEdgeMaths.animatedY
1299 z: windowedRightEdgeMaths.animatedZ
1434 z: windowedRightEdgeMaths.animatedZ
1300 height: stagedRightEdgeMaths.animatedHeight
1435 height: stagedRightEdgeMaths.animatedHeight
1301− requestedWidth: decoratedWindow.oldRequestedWidth
1302− requestedHeight: decoratedWindow.oldRequestedHeight
1304 PropertyChanges {
1437 PropertyChanges {
1305 target: decoratedWindow
1438 target: decoratedWindow
@@ -1322,11 +1455,15 @@ FocusScope {
1322 target: appDelegate
1455 target: appDelegate
1323 x: stageMaths.itemX
1456 x: stageMaths.itemX
1324 y: root.availableDesktopArea.y
1457 y: root.availableDesktopArea.y
1325− requestedWidth: appContainer.width
1326− requestedHeight: root.availableDesktopArea.height
1327 visuallyMaximized: true
1458 visuallyMaximized: true
1328 visible: appDelegate.x < root.width
1459 visible: appDelegate.x < root.width
1462+ target: appDelegate
1463+ requestedWidth: appContainer.width
1464+ requestedHeight: root.availableDesktopArea.height
1465+ restoreEntryValues: false
1330 PropertyChanges {
1467 PropertyChanges {
1331 target: decoratedWindow
1468 target: decoratedWindow
1332 hasDecoration: false
1469 hasDecoration: false
@@ -1355,11 +1492,15 @@ FocusScope {
1355 x: stageMaths.itemX
1492 x: stageMaths.itemX
1356 y: root.availableDesktopArea.y
1493 y: root.availableDesktopArea.y
1357 z: stageMaths.itemZ
1494 z: stageMaths.itemZ
1358− requestedWidth: stageMaths.itemWidth
1359− requestedHeight: root.availableDesktopArea.height
1360 visuallyMaximized: true
1495 visuallyMaximized: true
1361 visible: appDelegate.x < root.width
1496 visible: appDelegate.x < root.width
1499+ target: appDelegate
1500+ requestedWidth: stageMaths.itemWidth
1501+ requestedHeight: root.availableDesktopArea.height
1502+ restoreEntryValues: false
1363 PropertyChanges {
1504 PropertyChanges {
1364 target: decoratedWindow
1505 target: decoratedWindow
1365 hasDecoration: false
1506 hasDecoration: false
@@ -1381,8 +1522,12 @@ FocusScope {
1381 requestedY: 0;
1522 requestedY: 0;
1382 visuallyMinimized: false;
1523 visuallyMinimized: false;
1383 visuallyMaximized: true
1524 visuallyMaximized: true
1527+ target: appDelegate
1384 requestedWidth: root.availableDesktopArea.width;
1528 requestedWidth: root.availableDesktopArea.width;
1385 requestedHeight: appContainer.height;
1529 requestedHeight: appContainer.height;
1530+ restoreEntryValues: false
1387 PropertyChanges { target: touchControls; enabled: true }
1532 PropertyChanges { target: touchControls; enabled: true }
@@ -1392,8 +1537,12 @@ FocusScope {
1392 target: appDelegate;
1537 target: appDelegate;
1393 requestedX: 0
1538 requestedX: 0
1394 requestedY: 0
1539 requestedY: 0
1542+ target: appDelegate
1395− requestedWidth: appContainer.width;
1543+ requestedWidth: appContainer.width
1396− requestedHeight: appContainer.height;
1544+ requestedHeight: appContainer.height
1545+ restoreEntryValues: false
1398 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1547 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1408,6 +1557,12 @@ FocusScope {
1408 PropertyChanges { target: touchControls; enabled: true }
1557 PropertyChanges { target: touchControls; enabled: true }
1409 PropertyChanges { target: resizeArea; enabled: true }
1558 PropertyChanges { target: resizeArea; enabled: true }
1410 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1559 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1561+ target: appDelegate
1562+ requestedWidth: windowedWidth
1563+ requestedHeight: windowedHeight
1564+ restoreEntryValues: false
1413 name: "restored";
1568 name: "restored";
@@ -1508,6 +1663,10 @@ FocusScope {
1667+ print("item", index, "state changed", state)
1511 transitions: [
1670 transitions: [
1512 Transition {
1671 Transition {
1513 from: "staged,stagedWithSideStage"
1672 from: "staged,stagedWithSideStage"
@@ -1521,6 +1680,7 @@ FocusScope {
1521 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1680 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1523 Transition {
1682 Transition {
1683+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1524 to: "spread"
1684 to: "spread"
1525 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1685 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1526 PropertyAction { target: appDelegate; properties: "z,visible" }
1686 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1606,7 +1766,7 @@ FocusScope {
1608 Binding {
1768 Binding {
1609− target: PanelState
1769+ target: panelState
1610 property: "decorationsAlwaysVisible"
1770 property: "decorationsAlwaysVisible"
1611 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1771 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1627,6 +1787,7 @@ FocusScope {
1627 borderThickness: units.gu(2)
1787 borderThickness: units.gu(2)
1628 enabled: false
1788 enabled: false
1629 visible: enabled
1789 visible: enabled
1790+ readyToAssesBounds: !appDelegate._constructing
1631 onPressed: {
1792 onPressed: {
1632 appDelegate.activate();
1793 appDelegate.activate();
@@ -1650,18 +1811,13 @@ FocusScope {
1650 width: implicitWidth
1811 width: implicitWidth
1651 height: implicitHeight
1812 height: implicitHeight
1652 highlightSize: windowInfoItem.iconMargin / 2
1813 highlightSize: windowInfoItem.iconMargin / 2
1653− altDragEnabled: root.mode == "windowed"
1654 boundsItem: root.availableDesktopArea
1814 boundsItem: root.availableDesktopArea
1815+ panelState: root.panelState
1816+ altDragEnabled: root.mode == "windowed"
1656 requestedWidth: appDelegate.requestedWidth
1818 requestedWidth: appDelegate.requestedWidth
1657 requestedHeight: appDelegate.requestedHeight
1819 requestedHeight: appDelegate.requestedHeight
1659− property int oldRequestedWidth: -1
1660− property int oldRequestedHeight: -1
1662− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1663− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1665 onCloseClicked: { appDelegate.close(); }
1821 onCloseClicked: { appDelegate.close(); }
1666 onMaximizeClicked: {
1822 onMaximizeClicked: {
1667 if (appDelegate.canBeMaximized) {
1823 if (appDelegate.canBeMaximized) {
@@ -1742,6 +1898,8 @@ FocusScope {
1742 anchors.fill: decoratedWindow
1898 anchors.fill: decoratedWindow
1743 enabled: false
1899 enabled: false
1744 closeable: !appDelegate.isDash
1900 closeable: !appDelegate.isDash
1902+ dragDelegate: fakeDragItem
1746 onClicked: {
1904 onClicked: {
1747 spreadItem.highlightedIndex = index;
1905 spreadItem.highlightedIndex = index;
@@ -1784,12 +1942,15 @@ FocusScope {
1784 objectName: "closeMouseArea"
1942 objectName: "closeMouseArea"
1785 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1943 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1786 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1944 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1787− visible: !appDelegate.isDash && dragArea.distance == 0
1945+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1788 && index == spreadItem.highlightedIndex
1946 && index == spreadItem.highlightedIndex
1789 && mousePos.y < (decoratedWindow.height / 3)
1947 && mousePos.y < (decoratedWindow.height / 3)
1790 && mousePos.y > -units.gu(4)
1948 && mousePos.y > -units.gu(4)
1791 && mousePos.x > -units.gu(4)
1949 && mousePos.x > -units.gu(4)
1792 && mousePos.x < (decoratedWindow.width * 2 / 3)
1950 && mousePos.x < (decoratedWindow.width * 2 / 3)
1951+ opacity: shown ? 1 : 0
1952+ visible: opacity > 0
1953+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1793 height: units.gu(6)
1954 height: units.gu(6)
1794 width: height
1955 width: height
@@ -1860,83 +2021,19 @@ FocusScope {
1860 leftMargin: root.availableDesktopArea.x
2021 leftMargin: root.availableDesktopArea.x
1861 appContainerWidth: appContainer.width
2022 appContainerWidth: appContainer.width
1862 appContainerHeight: appContainer.height
2023 appContainerHeight: appContainer.height
2024+ panelState: root.panelState
1865− MouseArea {
2027+ WorkspaceSwitcher {
1866− id: hoverMouseArea
2028+ id: workspaceSwitcher
1867− objectName: "hoverMouseArea"
2029+ anchors.centerIn: parent
1868− anchors.fill: appContainer
2030+ height: units.gu(20)
1869− propagateComposedEvents: true
2031+ background: root.background
1870− hoverEnabled: true
2032+ onActiveChanged: {
1871− enabled: false
2033+ if (!active) {
1872− visible: enabled
2034+ appContainer.focus = true;
1874− property int scrollAreaWidth: width / 3
1875− property bool progressiveScrollingEnabled: false
1878− mouse.accepted = false
1880− if (hoverMouseArea.pressed) {
1884− // Find the hovered item and mark it active
1885− for (var i = appRepeater.count - 1; i >= 0; i--) {
1886− var appDelegate = appRepeater.itemAt(i);
1887− var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1888− var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1889− if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1890− spreadItem.highlightedIndex = i;
1895− if (floatingFlickable.contentWidth > floatingFlickable.width) {
1896− var margins = floatingFlickable.width * 0.05;
1898− if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1899− progressiveScrollingEnabled = true
1902− // do we need to scroll?
1903− if (mouseX < scrollAreaWidth + margins) {
1904− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1905− var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1906− floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1908− if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1909− var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1910− var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1911− floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1916− onPressed: mouse.accepted = false
1919− FloatingFlickable {
1920− id: floatingFlickable
1921− objectName: "spreadFlickable"
1922− anchors.fill: appContainer
1924− contentWidth: spreadItem.spreadTotalWidth
1926− function snap(toIndex) {
1927− var delegate = appRepeater.itemAt(toIndex)
1928− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1929− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1930− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1931− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1932− snapAnimation.start();
1933− } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1934− var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1935− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1936− snapAnimation.start();
1939− UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
1942 PropertyAnimation {
2039 PropertyAnimation {