@@ -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
@@ -575,6 +608,83 @@ FocusScope {
575 onLeaveSpread: {
608 onLeaveSpread: {
576 priv.goneToSpread = false;
609 priv.goneToSpread = false;
613+ id: floatingFlickable
614+ objectName: "spreadFlickable"
615+ anchors.fill: parent
617+ contentWidth: spreadItem.spreadTotalWidth
619+ function snap(toIndex) {
620+ var delegate = appRepeater.itemAt(toIndex)
621+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
622+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
623+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
624+ snapAnimation.to = floatingFlickable.contentX - offset;
625+ snapAnimation.start();
626+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
627+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
628+ snapAnimation.to = floatingFlickable.contentX - offset;
629+ snapAnimation.start();
632+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
637+ objectName: "hoverMouseArea"
638+ anchors.fill: parent
639+ propagateComposedEvents: true
644+ property int scrollAreaWidth: width / 3
645+ property bool progressiveScrollingEnabled: false
647+ onPressed: mouse.accepted = false
650+ mouse.accepted = false
652+ if (hoverMouseArea.pressed) {
656+ // Find the hovered item and mark it active
657+ for (var i = appRepeater.count - 1; i >= 0; i--) {
658+ var appDelegate = appRepeater.itemAt(i);
659+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
660+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
661+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
662+ spreadItem.highlightedIndex = i;
667+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
668+ var margins = floatingFlickable.width * 0.05;
670+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
671+ progressiveScrollingEnabled = true
674+ // do we need to scroll?
675+ if (mouseX < scrollAreaWidth + margins) {
676+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
677+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
678+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
680+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
681+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
682+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
683+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
580 Connections {
690 Connections {
@@ -669,10 +779,28 @@ FocusScope {
784+ property real previewScale: .5
785+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
787+ width: implicitWidth * height / implicitHeight
790+ opacity: surface != null ? 1 : 0
791+ Behavior on opacity { UbuntuNumberAnimation {} }
792+ visible: opacity > 0
794+ Drag.active: surface != null
795+ Drag.keys: ["application"]
673 id: boundariesForWindowPlacement
801 id: boundariesForWindowPlacement
674 anchors.fill: parent
802 anchors.fill: parent
675− anchors.topMargin: PanelState.panelHeight
803+ anchors.topMargin: panelState.panelHeight
676 visible: false
804 visible: false
@@ -704,6 +832,9 @@ FocusScope {
705 z: normalZ
833 z: normalZ
835+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
836+ Behavior on opacity { UbuntuNumberAnimation {} }
707 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
838 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
708 // match what the actual surface size is.
839 // match what the actual surface size is.
709 // Don't write to those, they will be set by states
840 // Don't write to those, they will be set by states
@@ -765,7 +896,7 @@ FocusScope {
765 target: appDelegate
896 target: appDelegate
766 property: "y"
897 property: "y"
767 value: appDelegate.requestedY -
898 value: appDelegate.requestedY -
768− Math.min(appDelegate.requestedY - PanelState.panelHeight,
899+ Math.min(appDelegate.requestedY - panelState.panelHeight,
769 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
900 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
770 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
901 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
771 && root.inputMethodRect.height > 0
902 && root.inputMethodRect.height > 0
@@ -876,7 +1007,6 @@ FocusScope {
876 function claimFocus() {
1007 function claimFocus() {
877 if (root.state == "spread") {
1008 if (root.state == "spread") {
878 spreadItem.highlightedIndex = index
1009 spreadItem.highlightedIndex = index
879− priv.goneToSpread = false;
881 if (root.mode == "stagedWithSideStage") {
1011 if (root.mode == "stagedWithSideStage") {
882 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1012 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1163,7 +1293,7 @@ FocusScope {
1163 progress: 0
1293 progress: 0
1164 targetHeight: spreadItem.stackHeight
1294 targetHeight: spreadItem.stackHeight
1165 targetX: spreadMaths.targetX
1295 targetX: spreadMaths.targetX
1166− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1296+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1167 targetY: spreadMaths.targetY
1297 targetY: spreadMaths.targetY
1168 targetAngle: spreadMaths.targetAngle
1298 targetAngle: spreadMaths.targetAngle
1169 targetScale: spreadMaths.targetScale
1299 targetScale: spreadMaths.targetScale
@@ -1209,8 +1339,6 @@ FocusScope {
1209 y: spreadMaths.targetY
1339 y: spreadMaths.targetY
1210 z: index
1340 z: index
1211 height: spreadItem.spreadItemHeight
1341 height: spreadItem.spreadItemHeight
1212− requestedWidth: decoratedWindow.oldRequestedWidth
1213− requestedHeight: decoratedWindow.oldRequestedHeight
1214 visible: spreadMaths.itemVisible
1342 visible: spreadMaths.itemVisible
1216 PropertyChanges { target: dragArea; enabled: true }
1344 PropertyChanges { target: dragArea; enabled: true }
@@ -1230,8 +1358,6 @@ FocusScope {
1230 y: stagedRightEdgeMaths.animatedY
1358 y: stagedRightEdgeMaths.animatedY
1231 z: stagedRightEdgeMaths.animatedZ
1359 z: stagedRightEdgeMaths.animatedZ
1232 height: stagedRightEdgeMaths.animatedHeight
1360 height: stagedRightEdgeMaths.animatedHeight
1233− requestedWidth: decoratedWindow.oldRequestedWidth
1234− requestedHeight: decoratedWindow.oldRequestedHeight
1235 visible: appDelegate.x < root.width
1361 visible: appDelegate.x < root.width
1237 PropertyChanges {
1363 PropertyChanges {
@@ -1261,8 +1387,6 @@ FocusScope {
1261 y: windowedRightEdgeMaths.animatedY
1387 y: windowedRightEdgeMaths.animatedY
1262 z: windowedRightEdgeMaths.animatedZ
1388 z: windowedRightEdgeMaths.animatedZ
1263 height: stagedRightEdgeMaths.animatedHeight
1389 height: stagedRightEdgeMaths.animatedHeight
1264− requestedWidth: decoratedWindow.oldRequestedWidth
1265− requestedHeight: decoratedWindow.oldRequestedHeight
1267 PropertyChanges {
1391 PropertyChanges {
1268 target: decoratedWindow
1392 target: decoratedWindow
@@ -1284,12 +1408,16 @@ FocusScope {
1284 PropertyChanges {
1408 PropertyChanges {
1285 target: appDelegate
1409 target: appDelegate
1286 x: stageMaths.itemX
1410 x: stageMaths.itemX
1287− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1411+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1288− requestedWidth: appContainer.width
1289− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1290 visuallyMaximized: true
1412 visuallyMaximized: true
1291 visible: appDelegate.x < root.width
1413 visible: appDelegate.x < root.width
1416+ target: appDelegate
1417+ requestedWidth: appContainer.width
1418+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1419+ restoreEntryValues: false
1293 PropertyChanges {
1421 PropertyChanges {
1294 target: decoratedWindow
1422 target: decoratedWindow
1295 hasDecoration: false
1423 hasDecoration: false
@@ -1312,13 +1440,17 @@ FocusScope {
1312 PropertyChanges {
1440 PropertyChanges {
1313 target: appDelegate
1441 target: appDelegate
1314 x: stageMaths.itemX
1442 x: stageMaths.itemX
1315− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1443+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1316 z: stageMaths.itemZ
1444 z: stageMaths.itemZ
1317− requestedWidth: stageMaths.itemWidth
1318− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1319 visuallyMaximized: true
1445 visuallyMaximized: true
1320 visible: appDelegate.x < root.width
1446 visible: appDelegate.x < root.width
1449+ target: appDelegate
1450+ requestedWidth: stageMaths.itemWidth
1451+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1452+ restoreEntryValues: false
1322 PropertyChanges {
1454 PropertyChanges {
1323 target: decoratedWindow
1455 target: decoratedWindow
1324 hasDecoration: false
1456 hasDecoration: false
@@ -1336,8 +1468,12 @@ FocusScope {
1336 requestedY: 0;
1468 requestedY: 0;
1337 visuallyMinimized: false;
1469 visuallyMinimized: false;
1338 visuallyMaximized: true
1470 visuallyMaximized: true
1473+ target: appDelegate
1339− requestedWidth: appContainer.width - root.leftMargin;
1474+ requestedWidth: appContainer.width - root.leftMargin
1340− requestedHeight: appContainer.height;
1475+ requestedHeight: appContainer.height
1476+ restoreEntryValues: false
1342 PropertyChanges { target: touchControls; enabled: true }
1478 PropertyChanges { target: touchControls; enabled: true }
@@ -1347,8 +1483,12 @@ FocusScope {
1347 target: appDelegate;
1483 target: appDelegate;
1348 requestedX: 0
1484 requestedX: 0
1349 requestedY: 0
1485 requestedY: 0
1488+ target: appDelegate
1350− requestedWidth: appContainer.width;
1489+ requestedWidth: appContainer.width
1351− requestedHeight: appContainer.height;
1490+ requestedHeight: appContainer.height
1491+ restoreEntryValues: false
1353 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1493 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1363,6 +1503,12 @@ FocusScope {
1363 PropertyChanges { target: touchControls; enabled: true }
1503 PropertyChanges { target: touchControls; enabled: true }
1364 PropertyChanges { target: resizeArea; enabled: true }
1504 PropertyChanges { target: resizeArea; enabled: true }
1365 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1505 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1507+ target: appDelegate
1508+ requestedWidth: windowedWidth
1509+ requestedHeight: windowedHeight
1510+ restoreEntryValues: false
1368 name: "restored";
1514 name: "restored";
@@ -1380,9 +1526,9 @@ FocusScope {
1380 PropertyChanges {
1526 PropertyChanges {
1381 target: appDelegate
1527 target: appDelegate
1382 windowedX: root.leftMargin
1528 windowedX: root.leftMargin
1383− windowedY: PanelState.panelHeight
1529+ windowedY: panelState.panelHeight
1384 windowedWidth: (appContainer.width - root.leftMargin)/2
1530 windowedWidth: (appContainer.width - root.leftMargin)/2
1385− windowedHeight: appContainer.height - PanelState.panelHeight
1531+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1399,9 +1545,9 @@ FocusScope {
1399 PropertyChanges {
1545 PropertyChanges {
1400 target: appDelegate
1546 target: appDelegate
1401 windowedX: root.leftMargin
1547 windowedX: root.leftMargin
1402− windowedY: PanelState.panelHeight
1548+ windowedY: panelState.panelHeight
1403 windowedWidth: (appContainer.width - root.leftMargin)/2
1549 windowedWidth: (appContainer.width - root.leftMargin)/2
1404− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1550+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1418,7 +1564,7 @@ FocusScope {
1418 PropertyChanges {
1564 PropertyChanges {
1419 target: appDelegate
1565 target: appDelegate
1420 windowedX: root.leftMargin
1566 windowedX: root.leftMargin
1421− windowedY: (appContainer.height + PanelState.panelHeight)/2
1567+ windowedY: (appContainer.height + panelState.panelHeight)/2
1422 windowedWidth: (appContainer.width - root.leftMargin)/2
1568 windowedWidth: (appContainer.width - root.leftMargin)/2
1423 windowedHeight: appContainer.height/2
1569 windowedHeight: appContainer.height/2
@@ -1440,8 +1586,8 @@ FocusScope {
1441 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1587 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1442 extend: "normal"
1588 extend: "normal"
1443− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1589+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1444− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1590+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1447 name: "minimized"; when: appDelegate.minimized
1593 name: "minimized"; when: appDelegate.minimized
@@ -1456,6 +1602,10 @@ FocusScope {
1606+ print("item", index, "state changed", state)
1459 transitions: [
1609 transitions: [
1460 Transition {
1610 Transition {
1461 from: "staged,stagedWithSideStage"
1611 from: "staged,stagedWithSideStage"
@@ -1469,6 +1619,7 @@ FocusScope {
1469 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1619 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1471 Transition {
1621 Transition {
1622+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1472 to: "spread"
1623 to: "spread"
1473 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1624 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1474 PropertyAction { target: appDelegate; properties: "z,visible" }
1625 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1554,7 +1705,7 @@ FocusScope {
1556 Binding {
1707 Binding {
1557− target: PanelState
1708+ target: panelState
1558 property: "decorationsAlwaysVisible"
1709 property: "decorationsAlwaysVisible"
1559 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1710 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1575,6 +1726,7 @@ FocusScope {
1575 borderThickness: units.gu(2)
1726 borderThickness: units.gu(2)
1576 enabled: false
1727 enabled: false
1577 visible: enabled
1728 visible: enabled
1729+ readyToAssesBounds: !appDelegate._constructing
1579 onPressed: {
1731 onPressed: {
1580 appDelegate.activate();
1732 appDelegate.activate();
@@ -1598,16 +1750,11 @@ FocusScope {
1598 height: implicitHeight
1750 height: implicitHeight
1599 highlightSize: windowInfoItem.iconMargin / 2
1751 highlightSize: windowInfoItem.iconMargin / 2
1600 boundsItem: boundariesForWindowPlacement
1752 boundsItem: boundariesForWindowPlacement
1753+ panelState: root.panelState
1602 requestedWidth: appDelegate.requestedWidth
1755 requestedWidth: appDelegate.requestedWidth
1603 requestedHeight: appDelegate.requestedHeight
1756 requestedHeight: appDelegate.requestedHeight
1605− property int oldRequestedWidth: -1
1606− property int oldRequestedHeight: -1
1608− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1609− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1611 onCloseClicked: { appDelegate.close(); }
1758 onCloseClicked: { appDelegate.close(); }
1612 onMaximizeClicked: {
1759 onMaximizeClicked: {
1613 if (appDelegate.canBeMaximized) {
1760 if (appDelegate.canBeMaximized) {
@@ -1688,6 +1835,8 @@ FocusScope {
1688 anchors.fill: decoratedWindow
1835 anchors.fill: decoratedWindow
1689 enabled: false
1836 enabled: false
1690 closeable: !appDelegate.isDash
1837 closeable: !appDelegate.isDash
1839+ dragDelegate: fakeDragItem
1692 onClicked: {
1841 onClicked: {
1693 spreadItem.highlightedIndex = index;
1842 spreadItem.highlightedIndex = index;
@@ -1730,12 +1879,15 @@ FocusScope {
1730 objectName: "closeMouseArea"
1879 objectName: "closeMouseArea"
1731 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1880 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1732 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1881 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1733− visible: !appDelegate.isDash && dragArea.distance == 0
1882+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1734 && index == spreadItem.highlightedIndex
1883 && index == spreadItem.highlightedIndex
1735 && mousePos.y < (decoratedWindow.height / 3)
1884 && mousePos.y < (decoratedWindow.height / 3)
1736 && mousePos.y > -units.gu(4)
1885 && mousePos.y > -units.gu(4)
1737 && mousePos.x > -units.gu(4)
1886 && mousePos.x > -units.gu(4)
1738 && mousePos.x < (decoratedWindow.width * 2 / 3)
1887 && mousePos.x < (decoratedWindow.width * 2 / 3)
1888+ opacity: shown ? 1 : 0
1889+ visible: opacity > 0
1890+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1739 height: units.gu(6)
1891 height: units.gu(6)
1740 width: height
1892 width: height
@@ -1797,83 +1949,19 @@ FocusScope {
1797 leftMargin: root.leftMargin
1949 leftMargin: root.leftMargin
1798 appContainerWidth: appContainer.width
1950 appContainerWidth: appContainer.width
1799 appContainerHeight: appContainer.height
1951 appContainerHeight: appContainer.height
1952+ panelState: root.panelState
1802− MouseArea {
1955+ WorkspaceSwitcher {
1803− id: hoverMouseArea
1956+ id: workspaceSwitcher
1804− objectName: "hoverMouseArea"
1957+ anchors.centerIn: parent
1805− anchors.fill: appContainer
1958+ height: units.gu(20)
1806− propagateComposedEvents: true
1959+ background: root.background
1807− hoverEnabled: true
1960+ onActiveChanged: {
1808− enabled: false
1961+ if (!active) {
1809− visible: enabled
1962+ appContainer.focus = true;
1811− property int scrollAreaWidth: width / 3
1812− property bool progressiveScrollingEnabled: false
1815− mouse.accepted = false
1817− if (hoverMouseArea.pressed) {
1821− // Find the hovered item and mark it active
1822− for (var i = appRepeater.count - 1; i >= 0; i--) {
1823− var appDelegate = appRepeater.itemAt(i);
1824− var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1825− var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1826− if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1827− spreadItem.highlightedIndex = i;
1832− if (floatingFlickable.contentWidth > floatingFlickable.width) {
1833− var margins = floatingFlickable.width * 0.05;
1835− if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1836− progressiveScrollingEnabled = true
1839− // do we need to scroll?
1840− if (mouseX < scrollAreaWidth + margins) {
1841− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1842− var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1843− floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1845− if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1846− var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1847− var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1848− floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1853− onPressed: mouse.accepted = false
1856− FloatingFlickable {
1857− id: floatingFlickable
1858− objectName: "spreadFlickable"
1859− anchors.fill: appContainer
1861− contentWidth: spreadItem.spreadTotalWidth
1863− function snap(toIndex) {
1864− var delegate = appRepeater.itemAt(toIndex)
1865− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1866− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1867− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1868− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1869− snapAnimation.start();
1870− } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1871− var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1872− snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1873− snapAnimation.start();
1876− UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
1879 PropertyAnimation {
1967 PropertyAnimation {