@@ -47,6 +47,7 @@ FocusScope {
47 property bool oskEnabled: false
47 property bool oskEnabled: false
48 property rect inputMethodRect
48 property rect inputMethodRect
49 property real rightEdgePushProgress: 0
49 property real rightEdgePushProgress: 0
50+ property PanelState panelState
51 // Configuration
52 // Configuration
52 property string mode: "staged"
53 property string mode: "staged"
@@ -224,6 +225,25 @@ FocusScope {
224 active: priv.focusedAppDelegate !== null
225 active: priv.focusedAppDelegate !== null
229+ id: showWorkspaceSwitcherShortcutLeft
230+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Left
231+ active: !workspaceSwitcher.active
234+ workspaceSwitcher.showLeft()
238+ id: showWorkspaceSwitcherShortcutRight
239+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right
240+ active: !workspaceSwitcher.active
243+ workspaceSwitcher.showRight()
227 QtObject {
247 QtObject {
229 objectName: "DesktopStagePrivate"
249 objectName: "DesktopStagePrivate"
@@ -349,23 +369,23 @@ FocusScope {
349 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
369 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
352− Component.onCompleted: priv.updateMainAndSideStageIndexes();
372+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
354 Connections {
374 Connections {
355− target: PanelState
375+ target: panelState
356 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
376 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
357 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
377 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
358 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
378 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
361 Binding {
381 Binding {
362− target: PanelState
382+ target: panelState
363 property: "decorationsVisible"
383 property: "decorationsVisible"
364 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
384 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
367 Binding {
387 Binding {
368− target: PanelState
388+ target: panelState
369 property: "title"
389 property: "title"
371 if (priv.focusedAppDelegate !== null) {
391 if (priv.focusedAppDelegate !== null) {
@@ -380,7 +400,7 @@ FocusScope {
382 Binding {
402 Binding {
383− target: PanelState
403+ target: panelState
384 property: "focusedPersistentSurfaceId"
404 property: "focusedPersistentSurfaceId"
386 if (priv.focusedAppDelegate !== null) {
406 if (priv.focusedAppDelegate !== null) {
@@ -394,21 +414,21 @@ FocusScope {
396 Binding {
416 Binding {
397− target: PanelState
417+ target: panelState
398 property: "dropShadow"
418 property: "dropShadow"
399 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
419 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
402 Binding {
422 Binding {
403− target: PanelState
423+ target: panelState
404 property: "closeButtonShown"
424 property: "closeButtonShown"
405 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
425 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
408 Component.onDestruction: {
428 Component.onDestruction: {
409− PanelState.title = "";
429+ panelState.title = "";
410− PanelState.decorationsVisible = false;
430+ panelState.decorationsVisible = false;
411− PanelState.dropShadow = false;
431+ panelState.dropShadow = false;
414 Instantiator {
434 Instantiator {
@@ -454,6 +474,7 @@ FocusScope {
454 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
474 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
455 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
475 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
456 PropertyChanges { target: wallpaper; visible: false }
476 PropertyChanges { target: wallpaper; visible: false }
477+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
459 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
480 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -502,10 +523,13 @@ FocusScope {
502 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
523 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
503 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
524 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
504 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
525 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
526+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
506 Transition {
528 Transition {
507 to: "spread"
529 to: "spread"
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
530 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
531+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
532+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
510 Transition {
534 Transition {
511 from: "spread"
535 from: "spread"
@@ -563,10 +587,21 @@ FocusScope {
563 visible: false
587 visible: false
590+ ScreensAndWorkspaces {
591+ id: screensAndWorkspaces
592+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
593+ height: Math.max(units.gu(30), parent.height * .3)
594+ background: root.background
596+ visible: opacity > 0
598+ onCloseSpread: priv.goneToSpread = false;
567 id: spreadItem
602 id: spreadItem
568 objectName: "spreadItem"
603 objectName: "spreadItem"
569− anchors.fill: appContainer
604+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
570 leftMargin: root.leftMargin
605 leftMargin: root.leftMargin
571 model: root.topLevelSurfaceList
606 model: root.topLevelSurfaceList
572 spreadFlickable: floatingFlickable
607 spreadFlickable: floatingFlickable
@@ -581,6 +616,83 @@ FocusScope {
581 appRepeater.itemAt(highlightedIndex).close();
616 appRepeater.itemAt(highlightedIndex).close();
621+ id: floatingFlickable
622+ objectName: "spreadFlickable"
623+ anchors.fill: parent
625+ contentWidth: spreadItem.spreadTotalWidth
627+ function snap(toIndex) {
628+ var delegate = appRepeater.itemAt(toIndex)
629+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
630+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
631+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
632+ snapAnimation.to = floatingFlickable.contentX - offset;
633+ snapAnimation.start();
634+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
635+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
636+ snapAnimation.to = floatingFlickable.contentX - offset;
637+ snapAnimation.start();
640+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
645+ objectName: "hoverMouseArea"
646+ anchors.fill: parent
647+ propagateComposedEvents: true
652+ property int scrollAreaWidth: width / 3
653+ property bool progressiveScrollingEnabled: false
655+ onPressed: mouse.accepted = false
658+ mouse.accepted = false
660+ if (hoverMouseArea.pressed) {
664+ // Find the hovered item and mark it active
665+ for (var i = appRepeater.count - 1; i >= 0; i--) {
666+ var appDelegate = appRepeater.itemAt(i);
667+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
668+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
669+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
670+ spreadItem.highlightedIndex = i;
675+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
676+ var margins = floatingFlickable.width * 0.05;
678+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
679+ progressiveScrollingEnabled = true
682+ // do we need to scroll?
683+ if (mouseX < scrollAreaWidth + margins) {
684+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
685+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
686+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
688+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
689+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
690+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
691+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
586 Connections {
698 Connections {
@@ -675,10 +787,28 @@ FocusScope {
792+ property real previewScale: .5
793+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
795+ width: implicitWidth * height / implicitHeight
798+ opacity: surface != null ? 1 : 0
799+ Behavior on opacity { UbuntuNumberAnimation {} }
800+ visible: opacity > 0
802+ Drag.active: surface != null
803+ Drag.keys: ["application"]
679 id: boundariesForWindowPlacement
809 id: boundariesForWindowPlacement
680 anchors.fill: parent
810 anchors.fill: parent
681− anchors.topMargin: PanelState.panelHeight
811+ anchors.topMargin: panelState.panelHeight
682 visible: false
812 visible: false
@@ -710,6 +840,9 @@ FocusScope {
711 z: normalZ
841 z: normalZ
843+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
844+ Behavior on opacity { UbuntuNumberAnimation {} }
713 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
846 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
714 // match what the actual surface size is.
847 // match what the actual surface size is.
715 // Don't write to those, they will be set by states
848 // Don't write to those, they will be set by states
@@ -779,7 +912,7 @@ FocusScope {
779 target: appDelegate
912 target: appDelegate
780 property: "y"
913 property: "y"
781 value: appDelegate.requestedY -
914 value: appDelegate.requestedY -
782− Math.min(appDelegate.requestedY - PanelState.panelHeight,
915+ Math.min(appDelegate.requestedY - panelState.panelHeight,
783 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
916 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
784 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
917 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
785 && root.inputMethodRect.height > 0
918 && root.inputMethodRect.height > 0
@@ -890,7 +1023,6 @@ FocusScope {
890 function claimFocus() {
1023 function claimFocus() {
891 if (root.state == "spread") {
1024 if (root.state == "spread") {
892 spreadItem.highlightedIndex = index
1025 spreadItem.highlightedIndex = index
893− priv.goneToSpread = false;
895 if (root.mode == "stagedWithSideStage") {
1027 if (root.mode == "stagedWithSideStage") {
896 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1028 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1177,7 +1309,7 @@ FocusScope {
1177 progress: 0
1309 progress: 0
1178 targetHeight: spreadItem.stackHeight
1310 targetHeight: spreadItem.stackHeight
1179 targetX: spreadMaths.targetX
1311 targetX: spreadMaths.targetX
1180− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1312+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1181 targetY: spreadMaths.targetY
1313 targetY: spreadMaths.targetY
1182 targetAngle: spreadMaths.targetAngle
1314 targetAngle: spreadMaths.targetAngle
1183 targetScale: spreadMaths.targetScale
1315 targetScale: spreadMaths.targetScale
@@ -1223,8 +1355,6 @@ FocusScope {
1223 y: spreadMaths.targetY
1355 y: spreadMaths.targetY
1224 z: index
1356 z: index
1225 height: spreadItem.spreadItemHeight
1357 height: spreadItem.spreadItemHeight
1226− requestedWidth: decoratedWindow.oldRequestedWidth
1227− requestedHeight: decoratedWindow.oldRequestedHeight
1228 visible: spreadMaths.itemVisible
1358 visible: spreadMaths.itemVisible
1230 PropertyChanges { target: dragArea; enabled: true }
1360 PropertyChanges { target: dragArea; enabled: true }
@@ -1244,8 +1374,6 @@ FocusScope {
1244 y: stagedRightEdgeMaths.animatedY
1374 y: stagedRightEdgeMaths.animatedY
1245 z: stagedRightEdgeMaths.animatedZ
1375 z: stagedRightEdgeMaths.animatedZ
1246 height: stagedRightEdgeMaths.animatedHeight
1376 height: stagedRightEdgeMaths.animatedHeight
1247− requestedWidth: decoratedWindow.oldRequestedWidth
1248− requestedHeight: decoratedWindow.oldRequestedHeight
1249 visible: appDelegate.x < root.width
1377 visible: appDelegate.x < root.width
1251 PropertyChanges {
1379 PropertyChanges {
@@ -1275,8 +1403,6 @@ FocusScope {
1275 y: windowedRightEdgeMaths.animatedY
1403 y: windowedRightEdgeMaths.animatedY
1276 z: windowedRightEdgeMaths.animatedZ
1404 z: windowedRightEdgeMaths.animatedZ
1277 height: stagedRightEdgeMaths.animatedHeight
1405 height: stagedRightEdgeMaths.animatedHeight
1278− requestedWidth: decoratedWindow.oldRequestedWidth
1279− requestedHeight: decoratedWindow.oldRequestedHeight
1281 PropertyChanges {
1407 PropertyChanges {
1282 target: decoratedWindow
1408 target: decoratedWindow
@@ -1298,12 +1424,16 @@ FocusScope {
1298 PropertyChanges {
1424 PropertyChanges {
1299 target: appDelegate
1425 target: appDelegate
1300 x: stageMaths.itemX
1426 x: stageMaths.itemX
1301− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1427+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1302− requestedWidth: appContainer.width
1303− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1304 visuallyMaximized: true
1428 visuallyMaximized: true
1305 visible: appDelegate.x < root.width
1429 visible: appDelegate.x < root.width
1432+ target: appDelegate
1433+ requestedWidth: appContainer.width
1434+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1435+ restoreEntryValues: false
1307 PropertyChanges {
1437 PropertyChanges {
1308 target: decoratedWindow
1438 target: decoratedWindow
1309 hasDecoration: false
1439 hasDecoration: false
@@ -1330,13 +1460,17 @@ FocusScope {
1330 PropertyChanges {
1460 PropertyChanges {
1331 target: appDelegate
1461 target: appDelegate
1332 x: stageMaths.itemX
1462 x: stageMaths.itemX
1333− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1463+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1334 z: stageMaths.itemZ
1464 z: stageMaths.itemZ
1335− requestedWidth: stageMaths.itemWidth
1336− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1337 visuallyMaximized: true
1465 visuallyMaximized: true
1338 visible: appDelegate.x < root.width
1466 visible: appDelegate.x < root.width
1469+ target: appDelegate
1470+ requestedWidth: stageMaths.itemWidth
1471+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1472+ restoreEntryValues: false
1340 PropertyChanges {
1474 PropertyChanges {
1341 target: decoratedWindow
1475 target: decoratedWindow
1342 hasDecoration: false
1476 hasDecoration: false
@@ -1358,8 +1492,12 @@ FocusScope {
1358 requestedY: 0;
1492 requestedY: 0;
1359 visuallyMinimized: false;
1493 visuallyMinimized: false;
1360 visuallyMaximized: true
1494 visuallyMaximized: true
1497+ target: appDelegate
1361− requestedWidth: appContainer.width - root.leftMargin;
1498+ requestedWidth: appContainer.width - root.leftMargin
1362− requestedHeight: appContainer.height;
1499+ requestedHeight: appContainer.height
1500+ restoreEntryValues: false
1364 PropertyChanges { target: touchControls; enabled: true }
1502 PropertyChanges { target: touchControls; enabled: true }
@@ -1369,8 +1507,12 @@ FocusScope {
1369 target: appDelegate;
1507 target: appDelegate;
1370 requestedX: 0
1508 requestedX: 0
1371 requestedY: 0
1509 requestedY: 0
1512+ target: appDelegate
1372− requestedWidth: appContainer.width;
1513+ requestedWidth: appContainer.width
1373− requestedHeight: appContainer.height;
1514+ requestedHeight: appContainer.height
1515+ restoreEntryValues: false
1375 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1517 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1385,6 +1527,12 @@ FocusScope {
1385 PropertyChanges { target: touchControls; enabled: true }
1527 PropertyChanges { target: touchControls; enabled: true }
1386 PropertyChanges { target: resizeArea; enabled: true }
1528 PropertyChanges { target: resizeArea; enabled: true }
1387 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1529 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1531+ target: appDelegate
1532+ requestedWidth: windowedWidth
1533+ requestedHeight: windowedHeight
1534+ restoreEntryValues: false
1390 name: "restored";
1538 name: "restored";
@@ -1402,9 +1550,9 @@ FocusScope {
1402 PropertyChanges {
1550 PropertyChanges {
1403 target: appDelegate
1551 target: appDelegate
1404 windowedX: root.leftMargin
1552 windowedX: root.leftMargin
1405− windowedY: PanelState.panelHeight
1553+ windowedY: panelState.panelHeight
1406 windowedWidth: (appContainer.width - root.leftMargin)/2
1554 windowedWidth: (appContainer.width - root.leftMargin)/2
1407− windowedHeight: appContainer.height - PanelState.panelHeight
1555+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1421,9 +1569,9 @@ FocusScope {
1421 PropertyChanges {
1569 PropertyChanges {
1422 target: appDelegate
1570 target: appDelegate
1423 windowedX: root.leftMargin
1571 windowedX: root.leftMargin
1424− windowedY: PanelState.panelHeight
1572+ windowedY: panelState.panelHeight
1425 windowedWidth: (appContainer.width - root.leftMargin)/2
1573 windowedWidth: (appContainer.width - root.leftMargin)/2
1426− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1574+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1440,7 +1588,7 @@ FocusScope {
1440 PropertyChanges {
1588 PropertyChanges {
1441 target: appDelegate
1589 target: appDelegate
1442 windowedX: root.leftMargin
1590 windowedX: root.leftMargin
1443− windowedY: (appContainer.height + PanelState.panelHeight)/2
1591+ windowedY: (appContainer.height + panelState.panelHeight)/2
1444 windowedWidth: (appContainer.width - root.leftMargin)/2
1592 windowedWidth: (appContainer.width - root.leftMargin)/2
1445 windowedHeight: appContainer.height/2
1593 windowedHeight: appContainer.height/2
@@ -1462,8 +1610,8 @@ FocusScope {
1463 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1611 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1464 extend: "normal"
1612 extend: "normal"
1465− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1613+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1466− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1614+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1469 name: "minimized"; when: appDelegate.minimized
1617 name: "minimized"; when: appDelegate.minimized
@@ -1478,6 +1626,10 @@ FocusScope {
1630+ print("item", index, "state changed", state)
1481 transitions: [
1633 transitions: [
1482 Transition {
1634 Transition {
1483 from: "staged,stagedWithSideStage"
1635 from: "staged,stagedWithSideStage"
@@ -1491,6 +1643,7 @@ FocusScope {
1491 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1643 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1493 Transition {
1645 Transition {
1646+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1494 to: "spread"
1647 to: "spread"
1495 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1648 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1496 PropertyAction { target: appDelegate; properties: "z,visible" }
1649 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1576,7 +1729,7 @@ FocusScope {
1578 Binding {
1731 Binding {
1579− target: PanelState
1732+ target: panelState
1580 property: "decorationsAlwaysVisible"
1733 property: "decorationsAlwaysVisible"
1581 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1734 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1597,6 +1750,7 @@ FocusScope {
1597 borderThickness: units.gu(2)
1750 borderThickness: units.gu(2)
1598 enabled: false
1751 enabled: false
1599 visible: enabled
1752 visible: enabled
1753+ readyToAssesBounds: !appDelegate._constructing
1601 onPressed: {
1755 onPressed: {
1602 appDelegate.activate();
1756 appDelegate.activate();
@@ -1620,17 +1774,12 @@ FocusScope {
1620 height: implicitHeight
1774 height: implicitHeight
1621 highlightSize: windowInfoItem.iconMargin / 2
1775 highlightSize: windowInfoItem.iconMargin / 2
1622 boundsItem: boundariesForWindowPlacement
1776 boundsItem: boundariesForWindowPlacement
1777+ panelState: root.panelState
1623 altDragEnabled: root.mode == "windowed"
1778 altDragEnabled: root.mode == "windowed"
1625 requestedWidth: appDelegate.requestedWidth
1780 requestedWidth: appDelegate.requestedWidth
1626 requestedHeight: appDelegate.requestedHeight
1781 requestedHeight: appDelegate.requestedHeight
1628− property int oldRequestedWidth: -1
1629− property int oldRequestedHeight: -1
1631− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1632− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1634 onCloseClicked: { appDelegate.close(); }
1783 onCloseClicked: { appDelegate.close(); }
1635 onMaximizeClicked: {
1784 onMaximizeClicked: {
1636 if (appDelegate.canBeMaximized) {
1785 if (appDelegate.canBeMaximized) {
@@ -1711,6 +1860,8 @@ FocusScope {
1711 anchors.fill: decoratedWindow
1860 anchors.fill: decoratedWindow
1712 enabled: false
1861 enabled: false
1713 closeable: !appDelegate.isDash
1862 closeable: !appDelegate.isDash
1864+ dragDelegate: fakeDragItem
1715 onClicked: {
1866 onClicked: {
1716 spreadItem.highlightedIndex = index;
1867 spreadItem.highlightedIndex = index;
@@ -1753,12 +1904,15 @@ FocusScope {
1753 objectName: "closeMouseArea"
1904 objectName: "closeMouseArea"
1754 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1905 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1755 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1906 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1756− visible: !appDelegate.isDash && dragArea.distance == 0
1907+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1757 && index == spreadItem.highlightedIndex
1908 && index == spreadItem.highlightedIndex
1758 && mousePos.y < (decoratedWindow.height / 3)
1909 && mousePos.y < (decoratedWindow.height / 3)
1759 && mousePos.y > -units.gu(4)
1910 && mousePos.y > -units.gu(4)
1760 && mousePos.x > -units.gu(4)
1911 && mousePos.x > -units.gu(4)
1761 && mousePos.x < (decoratedWindow.width * 2 / 3)
1912 && mousePos.x < (decoratedWindow.width * 2 / 3)
1913+ opacity: shown ? 1 : 0
1914+ visible: opacity > 0
1915+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1762 height: units.gu(6)
1916 height: units.gu(6)
1763 width: height
1917 width: height
@@ -1820,83 +1974,19 @@ FocusScope {
1820 leftMargin: root.leftMargin
1974 leftMargin: root.leftMargin
1821 appContainerWidth: appContainer.width
1975 appContainerWidth: appContainer.width
1822 appContainerHeight: appContainer.height
1976 appContainerHeight: appContainer.height
1977+ panelState: root.panelState
1825− MouseArea {
1980+ WorkspaceSwitcher {
1826− id: hoverMouseArea
1981+ id: workspaceSwitcher
1827− objectName: "hoverMouseArea"
1982+ anchors.centerIn: parent
1828− anchors.fill: appContainer
1983+ height: units.gu(20)
1829− propagateComposedEvents: true
1984+ background: root.background
1830− hoverEnabled: true
1985+ onActiveChanged: {
1831− enabled: false
1986+ if (!active) {
1832− visible: enabled
1987+ appContainer.focus = true;
1834− property int scrollAreaWidth: width / 3
1835− property bool progressiveScrollingEnabled: false
1838− mouse.accepted = false
1840− if (hoverMouseArea.pressed) {
1844− // Find the hovered item and mark it active
1845− for (var i = appRepeater.count - 1; i >= 0; i--) {
1846− var appDelegate = appRepeater.itemAt(i);
1847− var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1848− var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1849− if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1850− spreadItem.highlightedIndex = i;
1855− if (floatingFlickable.contentWidth > floatingFlickable.width) {
1856− var margins = floatingFlickable.width * 0.05;
1858− if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1859− progressiveScrollingEnabled = true
1862− // do we need to scroll?
1863− if (mouseX < scrollAreaWidth + margins) {
1864− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1865− var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1866− floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1868− if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1869− var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1870− var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1871− floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1876− onPressed: mouse.accepted = false
1879− FloatingFlickable {
1880− id: floatingFlickable
1881− objectName: "spreadFlickable"
1882− anchors.fill: appContainer
1884− contentWidth: spreadItem.spreadTotalWidth
1886− function snap(toIndex) {
1887− var delegate = appRepeater.itemAt(toIndex)
1888− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1889− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1890− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1891− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1892− snapAnimation.start();
1893− } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1894− var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1895− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1896− snapAnimation.start();
1899− UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
1902 PropertyAnimation {
1992 PropertyAnimation {