@@ -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,23 @@ 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
233+ workspaceSwitcher.showLeft()
237+ id: showWorkspaceSwitcherShortcutRight
238+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right
239+ active: !workspaceSwitcher.active
241+ workspaceSwitcher.showRight()
227 QtObject {
245 QtObject {
229 objectName: "DesktopStagePrivate"
247 objectName: "DesktopStagePrivate"
@@ -349,23 +367,23 @@ FocusScope {
349 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
367 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
352− Component.onCompleted: priv.updateMainAndSideStageIndexes();
370+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
354 Connections {
372 Connections {
355− target: PanelState
373+ target: panelState
356 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
374 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
357 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
375 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
358 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
376 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
361 Binding {
379 Binding {
362− target: PanelState
380+ target: panelState
363 property: "decorationsVisible"
381 property: "decorationsVisible"
364 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
382 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
367 Binding {
385 Binding {
368− target: PanelState
386+ target: panelState
369 property: "title"
387 property: "title"
371 if (priv.focusedAppDelegate !== null) {
389 if (priv.focusedAppDelegate !== null) {
@@ -380,7 +398,7 @@ FocusScope {
382 Binding {
400 Binding {
383− target: PanelState
401+ target: panelState
384 property: "focusedPersistentSurfaceId"
402 property: "focusedPersistentSurfaceId"
386 if (priv.focusedAppDelegate !== null) {
404 if (priv.focusedAppDelegate !== null) {
@@ -394,21 +412,21 @@ FocusScope {
396 Binding {
414 Binding {
397− target: PanelState
415+ target: panelState
398 property: "dropShadow"
416 property: "dropShadow"
399 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
417 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
402 Binding {
420 Binding {
403− target: PanelState
421+ target: panelState
404 property: "closeButtonShown"
422 property: "closeButtonShown"
405 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
423 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
408 Component.onDestruction: {
426 Component.onDestruction: {
409− PanelState.title = "";
427+ panelState.title = "";
410− PanelState.decorationsVisible = false;
428+ panelState.decorationsVisible = false;
411− PanelState.dropShadow = false;
429+ panelState.dropShadow = false;
414 Instantiator {
432 Instantiator {
@@ -454,6 +472,7 @@ FocusScope {
454 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
472 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
455 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
473 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
456 PropertyChanges { target: wallpaper; visible: false }
474 PropertyChanges { target: wallpaper; visible: false }
475+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
459 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
478 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -502,10 +521,13 @@ FocusScope {
502 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
521 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
503 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
522 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
504 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
523 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
524+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
506 Transition {
526 Transition {
507 to: "spread"
527 to: "spread"
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
528 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
529+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
530+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
510 Transition {
532 Transition {
511 from: "spread"
533 from: "spread"
@@ -563,10 +585,21 @@ FocusScope {
563 visible: false
585 visible: false
588+ ScreensAndWorkspaces {
589+ id: screensAndWorkspaces
590+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
591+ height: Math.max(units.gu(30), parent.height * .3)
592+ background: root.background
594+ visible: opacity > 0
596+ onCloseSpread: priv.goneToSpread = false;
567 id: spreadItem
600 id: spreadItem
568 objectName: "spreadItem"
601 objectName: "spreadItem"
569− anchors.fill: appContainer
602+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
570 leftMargin: root.leftMargin
603 leftMargin: root.leftMargin
571 model: root.topLevelSurfaceList
604 model: root.topLevelSurfaceList
572 spreadFlickable: floatingFlickable
605 spreadFlickable: floatingFlickable
@@ -581,6 +614,83 @@ FocusScope {
581 appRepeater.itemAt(highlightedIndex).close();
614 appRepeater.itemAt(highlightedIndex).close();
619+ id: floatingFlickable
620+ objectName: "spreadFlickable"
621+ anchors.fill: parent
623+ contentWidth: spreadItem.spreadTotalWidth
625+ function snap(toIndex) {
626+ var delegate = appRepeater.itemAt(toIndex)
627+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
628+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
629+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
630+ snapAnimation.to = floatingFlickable.contentX - offset;
631+ snapAnimation.start();
632+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
633+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
634+ snapAnimation.to = floatingFlickable.contentX - offset;
635+ snapAnimation.start();
638+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
643+ objectName: "hoverMouseArea"
644+ anchors.fill: parent
645+ propagateComposedEvents: true
650+ property int scrollAreaWidth: width / 3
651+ property bool progressiveScrollingEnabled: false
653+ onPressed: mouse.accepted = false
656+ mouse.accepted = false
658+ if (hoverMouseArea.pressed) {
662+ // Find the hovered item and mark it active
663+ for (var i = appRepeater.count - 1; i >= 0; i--) {
664+ var appDelegate = appRepeater.itemAt(i);
665+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
666+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
667+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
668+ spreadItem.highlightedIndex = i;
673+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
674+ var margins = floatingFlickable.width * 0.05;
676+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
677+ progressiveScrollingEnabled = true
680+ // do we need to scroll?
681+ if (mouseX < scrollAreaWidth + margins) {
682+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
683+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
684+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
686+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
687+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
688+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
689+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
586 Connections {
696 Connections {
@@ -675,10 +785,28 @@ FocusScope {
790+ property real previewScale: .5
791+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
793+ width: implicitWidth * height / implicitHeight
796+ opacity: surface != null ? 1 : 0
797+ Behavior on opacity { UbuntuNumberAnimation {} }
798+ visible: opacity > 0
800+ Drag.active: surface != null
801+ Drag.keys: ["application"]
679 id: boundariesForWindowPlacement
807 id: boundariesForWindowPlacement
680 anchors.fill: parent
808 anchors.fill: parent
681− anchors.topMargin: PanelState.panelHeight
809+ anchors.topMargin: panelState.panelHeight
682 visible: false
810 visible: false
@@ -710,6 +838,9 @@ FocusScope {
711 z: normalZ
839 z: normalZ
841+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
842+ Behavior on opacity { UbuntuNumberAnimation {} }
713 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
844 // 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.
845 // match what the actual surface size is.
715 // Don't write to those, they will be set by states
846 // Don't write to those, they will be set by states
@@ -779,7 +910,7 @@ FocusScope {
779 target: appDelegate
910 target: appDelegate
780 property: "y"
911 property: "y"
781 value: appDelegate.requestedY -
912 value: appDelegate.requestedY -
782− Math.min(appDelegate.requestedY - PanelState.panelHeight,
913+ Math.min(appDelegate.requestedY - panelState.panelHeight,
783 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
914 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
784 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
915 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
785 && root.inputMethodRect.height > 0
916 && root.inputMethodRect.height > 0
@@ -890,7 +1021,6 @@ FocusScope {
890 function claimFocus() {
1021 function claimFocus() {
891 if (root.state == "spread") {
1022 if (root.state == "spread") {
892 spreadItem.highlightedIndex = index
1023 spreadItem.highlightedIndex = index
893− priv.goneToSpread = false;
895 if (root.mode == "stagedWithSideStage") {
1025 if (root.mode == "stagedWithSideStage") {
896 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1026 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1177,7 +1307,7 @@ FocusScope {
1177 progress: 0
1307 progress: 0
1178 targetHeight: spreadItem.stackHeight
1308 targetHeight: spreadItem.stackHeight
1179 targetX: spreadMaths.targetX
1309 targetX: spreadMaths.targetX
1180− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1310+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1181 targetY: spreadMaths.targetY
1311 targetY: spreadMaths.targetY
1182 targetAngle: spreadMaths.targetAngle
1312 targetAngle: spreadMaths.targetAngle
1183 targetScale: spreadMaths.targetScale
1313 targetScale: spreadMaths.targetScale
@@ -1223,8 +1353,6 @@ FocusScope {
1223 y: spreadMaths.targetY
1353 y: spreadMaths.targetY
1224 z: index
1354 z: index
1225 height: spreadItem.spreadItemHeight
1355 height: spreadItem.spreadItemHeight
1226− requestedWidth: decoratedWindow.oldRequestedWidth
1227− requestedHeight: decoratedWindow.oldRequestedHeight
1228 visible: spreadMaths.itemVisible
1356 visible: spreadMaths.itemVisible
1230 PropertyChanges { target: dragArea; enabled: true }
1358 PropertyChanges { target: dragArea; enabled: true }
@@ -1244,8 +1372,6 @@ FocusScope {
1244 y: stagedRightEdgeMaths.animatedY
1372 y: stagedRightEdgeMaths.animatedY
1245 z: stagedRightEdgeMaths.animatedZ
1373 z: stagedRightEdgeMaths.animatedZ
1246 height: stagedRightEdgeMaths.animatedHeight
1374 height: stagedRightEdgeMaths.animatedHeight
1247− requestedWidth: decoratedWindow.oldRequestedWidth
1248− requestedHeight: decoratedWindow.oldRequestedHeight
1249 visible: appDelegate.x < root.width
1375 visible: appDelegate.x < root.width
1251 PropertyChanges {
1377 PropertyChanges {
@@ -1275,8 +1401,6 @@ FocusScope {
1275 y: windowedRightEdgeMaths.animatedY
1401 y: windowedRightEdgeMaths.animatedY
1276 z: windowedRightEdgeMaths.animatedZ
1402 z: windowedRightEdgeMaths.animatedZ
1277 height: stagedRightEdgeMaths.animatedHeight
1403 height: stagedRightEdgeMaths.animatedHeight
1278− requestedWidth: decoratedWindow.oldRequestedWidth
1279− requestedHeight: decoratedWindow.oldRequestedHeight
1281 PropertyChanges {
1405 PropertyChanges {
1282 target: decoratedWindow
1406 target: decoratedWindow
@@ -1298,12 +1422,16 @@ FocusScope {
1298 PropertyChanges {
1422 PropertyChanges {
1299 target: appDelegate
1423 target: appDelegate
1300 x: stageMaths.itemX
1424 x: stageMaths.itemX
1301− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1425+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1302− requestedWidth: appContainer.width
1303− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1304 visuallyMaximized: true
1426 visuallyMaximized: true
1305 visible: appDelegate.x < root.width
1427 visible: appDelegate.x < root.width
1430+ target: appDelegate
1431+ requestedWidth: appContainer.width
1432+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1433+ restoreEntryValues: false
1307 PropertyChanges {
1435 PropertyChanges {
1308 target: decoratedWindow
1436 target: decoratedWindow
1309 hasDecoration: false
1437 hasDecoration: false
@@ -1330,13 +1458,17 @@ FocusScope {
1330 PropertyChanges {
1458 PropertyChanges {
1331 target: appDelegate
1459 target: appDelegate
1332 x: stageMaths.itemX
1460 x: stageMaths.itemX
1333− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1461+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1334 z: stageMaths.itemZ
1462 z: stageMaths.itemZ
1335− requestedWidth: stageMaths.itemWidth
1336− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1337 visuallyMaximized: true
1463 visuallyMaximized: true
1338 visible: appDelegate.x < root.width
1464 visible: appDelegate.x < root.width
1467+ target: appDelegate
1468+ requestedWidth: stageMaths.itemWidth
1469+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1470+ restoreEntryValues: false
1340 PropertyChanges {
1472 PropertyChanges {
1341 target: decoratedWindow
1473 target: decoratedWindow
1342 hasDecoration: false
1474 hasDecoration: false
@@ -1358,8 +1490,12 @@ FocusScope {
1358 requestedY: 0;
1490 requestedY: 0;
1359 visuallyMinimized: false;
1491 visuallyMinimized: false;
1360 visuallyMaximized: true
1492 visuallyMaximized: true
1495+ target: appDelegate
1361− requestedWidth: appContainer.width - root.leftMargin;
1496+ requestedWidth: appContainer.width - root.leftMargin
1362− requestedHeight: appContainer.height;
1497+ requestedHeight: appContainer.height
1498+ restoreEntryValues: false
1364 PropertyChanges { target: touchControls; enabled: true }
1500 PropertyChanges { target: touchControls; enabled: true }
@@ -1369,8 +1505,12 @@ FocusScope {
1369 target: appDelegate;
1505 target: appDelegate;
1370 requestedX: 0
1506 requestedX: 0
1371 requestedY: 0
1507 requestedY: 0
1510+ target: appDelegate
1372− requestedWidth: appContainer.width;
1511+ requestedWidth: appContainer.width
1373− requestedHeight: appContainer.height;
1512+ requestedHeight: appContainer.height
1513+ restoreEntryValues: false
1375 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1515 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1385,6 +1525,12 @@ FocusScope {
1385 PropertyChanges { target: touchControls; enabled: true }
1525 PropertyChanges { target: touchControls; enabled: true }
1386 PropertyChanges { target: resizeArea; enabled: true }
1526 PropertyChanges { target: resizeArea; enabled: true }
1387 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1527 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1529+ target: appDelegate
1530+ requestedWidth: windowedWidth
1531+ requestedHeight: windowedHeight
1532+ restoreEntryValues: false
1390 name: "restored";
1536 name: "restored";
@@ -1402,9 +1548,9 @@ FocusScope {
1402 PropertyChanges {
1548 PropertyChanges {
1403 target: appDelegate
1549 target: appDelegate
1404 windowedX: root.leftMargin
1550 windowedX: root.leftMargin
1405− windowedY: PanelState.panelHeight
1551+ windowedY: panelState.panelHeight
1406 windowedWidth: (appContainer.width - root.leftMargin)/2
1552 windowedWidth: (appContainer.width - root.leftMargin)/2
1407− windowedHeight: appContainer.height - PanelState.panelHeight
1553+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1421,9 +1567,9 @@ FocusScope {
1421 PropertyChanges {
1567 PropertyChanges {
1422 target: appDelegate
1568 target: appDelegate
1423 windowedX: root.leftMargin
1569 windowedX: root.leftMargin
1424− windowedY: PanelState.panelHeight
1570+ windowedY: panelState.panelHeight
1425 windowedWidth: (appContainer.width - root.leftMargin)/2
1571 windowedWidth: (appContainer.width - root.leftMargin)/2
1426− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1572+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1440,7 +1586,7 @@ FocusScope {
1440 PropertyChanges {
1586 PropertyChanges {
1441 target: appDelegate
1587 target: appDelegate
1442 windowedX: root.leftMargin
1588 windowedX: root.leftMargin
1443− windowedY: (appContainer.height + PanelState.panelHeight)/2
1589+ windowedY: (appContainer.height + panelState.panelHeight)/2
1444 windowedWidth: (appContainer.width - root.leftMargin)/2
1590 windowedWidth: (appContainer.width - root.leftMargin)/2
1445 windowedHeight: appContainer.height/2
1591 windowedHeight: appContainer.height/2
@@ -1462,8 +1608,8 @@ FocusScope {
1463 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1609 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1464 extend: "normal"
1610 extend: "normal"
1465− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1611+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1466− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1612+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1469 name: "minimized"; when: appDelegate.minimized
1615 name: "minimized"; when: appDelegate.minimized
@@ -1478,6 +1624,10 @@ FocusScope {
1628+ print("item", index, "state changed", state)
1481 transitions: [
1631 transitions: [
1482 Transition {
1632 Transition {
1483 from: "staged,stagedWithSideStage"
1633 from: "staged,stagedWithSideStage"
@@ -1491,6 +1641,7 @@ FocusScope {
1491 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1641 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1493 Transition {
1643 Transition {
1644+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1494 to: "spread"
1645 to: "spread"
1495 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1646 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1496 PropertyAction { target: appDelegate; properties: "z,visible" }
1647 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1576,7 +1727,7 @@ FocusScope {
1578 Binding {
1729 Binding {
1579− target: PanelState
1730+ target: panelState
1580 property: "decorationsAlwaysVisible"
1731 property: "decorationsAlwaysVisible"
1581 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1732 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1597,6 +1748,7 @@ FocusScope {
1597 borderThickness: units.gu(2)
1748 borderThickness: units.gu(2)
1598 enabled: false
1749 enabled: false
1599 visible: enabled
1750 visible: enabled
1751+ readyToAssesBounds: !appDelegate._constructing
1601 onPressed: {
1753 onPressed: {
1602 appDelegate.activate();
1754 appDelegate.activate();
@@ -1620,17 +1772,12 @@ FocusScope {
1620 height: implicitHeight
1772 height: implicitHeight
1621 highlightSize: windowInfoItem.iconMargin / 2
1773 highlightSize: windowInfoItem.iconMargin / 2
1622 boundsItem: boundariesForWindowPlacement
1774 boundsItem: boundariesForWindowPlacement
1775+ panelState: root.panelState
1623 altDragEnabled: root.mode == "windowed"
1776 altDragEnabled: root.mode == "windowed"
1625 requestedWidth: appDelegate.requestedWidth
1778 requestedWidth: appDelegate.requestedWidth
1626 requestedHeight: appDelegate.requestedHeight
1779 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(); }
1781 onCloseClicked: { appDelegate.close(); }
1635 onMaximizeClicked: {
1782 onMaximizeClicked: {
1636 if (appDelegate.canBeMaximized) {
1783 if (appDelegate.canBeMaximized) {
@@ -1711,6 +1858,8 @@ FocusScope {
1711 anchors.fill: decoratedWindow
1858 anchors.fill: decoratedWindow
1712 enabled: false
1859 enabled: false
1713 closeable: !appDelegate.isDash
1860 closeable: !appDelegate.isDash
1862+ dragDelegate: fakeDragItem
1715 onClicked: {
1864 onClicked: {
1716 spreadItem.highlightedIndex = index;
1865 spreadItem.highlightedIndex = index;
@@ -1753,12 +1902,15 @@ FocusScope {
1753 objectName: "closeMouseArea"
1902 objectName: "closeMouseArea"
1754 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1903 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)
1904 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1756− visible: !appDelegate.isDash && dragArea.distance == 0
1905+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1757 && index == spreadItem.highlightedIndex
1906 && index == spreadItem.highlightedIndex
1758 && mousePos.y < (decoratedWindow.height / 3)
1907 && mousePos.y < (decoratedWindow.height / 3)
1759 && mousePos.y > -units.gu(4)
1908 && mousePos.y > -units.gu(4)
1760 && mousePos.x > -units.gu(4)
1909 && mousePos.x > -units.gu(4)
1761 && mousePos.x < (decoratedWindow.width * 2 / 3)
1910 && mousePos.x < (decoratedWindow.width * 2 / 3)
1911+ opacity: shown ? 1 : 0
1912+ visible: opacity > 0
1913+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1762 height: units.gu(6)
1914 height: units.gu(6)
1763 width: height
1915 width: height
@@ -1820,83 +1972,19 @@ FocusScope {
1820 leftMargin: root.leftMargin
1972 leftMargin: root.leftMargin
1821 appContainerWidth: appContainer.width
1973 appContainerWidth: appContainer.width
1822 appContainerHeight: appContainer.height
1974 appContainerHeight: appContainer.height
1975+ panelState: root.panelState
1825− MouseArea {
1978+ WorkspaceSwitcher {
1826− id: hoverMouseArea
1979+ id: workspaceSwitcher
1827− objectName: "hoverMouseArea"
1980+ anchors.centerIn: parent
1828− anchors.fill: appContainer
1981+ height: units.gu(20)
1829− propagateComposedEvents: true
1982+ background: root.background
1830− hoverEnabled: true
1983+ onActiveChanged: {
1831− enabled: false
1984+ if (!active) {
1832− visible: enabled
1985+ 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 {
1990 PropertyAnimation {