@@ -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,21 @@ FocusScope {
224 active: priv.focusedAppDelegate !== null
225 active: priv.focusedAppDelegate !== null
229+ id: showWorkspaceSwitcherShortcutLeft
230+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Left
232+ workspaceSwitcher.left()
236+ id: showWorkspaceSwitcherShortcutRight
237+ shortcut: Qt.AltModifier|Qt.ControlModifier|Qt.Key_Right
239+ workspaceSwitcher.right()
227 QtObject {
243 QtObject {
229 objectName: "DesktopStagePrivate"
245 objectName: "DesktopStagePrivate"
@@ -349,23 +365,23 @@ FocusScope {
349 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
365 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
352− Component.onCompleted: priv.updateMainAndSideStageIndexes();
368+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
354 Connections {
370 Connections {
355− target: PanelState
371+ target: panelState
356 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
372 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
357 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
373 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
358 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
374 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
361 Binding {
377 Binding {
362− target: PanelState
378+ target: panelState
363 property: "decorationsVisible"
379 property: "decorationsVisible"
364 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
380 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
367 Binding {
383 Binding {
368− target: PanelState
384+ target: panelState
369 property: "title"
385 property: "title"
371 if (priv.focusedAppDelegate !== null) {
387 if (priv.focusedAppDelegate !== null) {
@@ -380,7 +396,7 @@ FocusScope {
382 Binding {
398 Binding {
383− target: PanelState
399+ target: panelState
384 property: "focusedPersistentSurfaceId"
400 property: "focusedPersistentSurfaceId"
386 if (priv.focusedAppDelegate !== null) {
402 if (priv.focusedAppDelegate !== null) {
@@ -394,21 +410,21 @@ FocusScope {
396 Binding {
412 Binding {
397− target: PanelState
413+ target: panelState
398 property: "dropShadow"
414 property: "dropShadow"
399 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
415 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
402 Binding {
418 Binding {
403− target: PanelState
419+ target: panelState
404 property: "closeButtonShown"
420 property: "closeButtonShown"
405 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
421 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
408 Component.onDestruction: {
424 Component.onDestruction: {
409− PanelState.title = "";
425+ panelState.title = "";
410− PanelState.decorationsVisible = false;
426+ panelState.decorationsVisible = false;
411− PanelState.dropShadow = false;
427+ panelState.dropShadow = false;
414 Instantiator {
430 Instantiator {
@@ -454,6 +470,7 @@ FocusScope {
454 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
470 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
455 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
471 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
456 PropertyChanges { target: wallpaper; visible: false }
472 PropertyChanges { target: wallpaper; visible: false }
473+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
459 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
476 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -502,10 +519,13 @@ FocusScope {
502 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
519 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
503 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
520 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
504 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
521 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
522+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
506 Transition {
524 Transition {
507 to: "spread"
525 to: "spread"
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
526 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
527+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
528+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
510 Transition {
530 Transition {
511 from: "spread"
531 from: "spread"
@@ -563,10 +583,21 @@ FocusScope {
563 visible: false
583 visible: false
586+ ScreensAndWorkspaces {
587+ id: screensAndWorkspaces
588+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
589+ height: Math.max(units.gu(30), parent.height * .3)
590+ background: root.background
592+ visible: opacity > 0
594+ onCloseSpread: priv.goneToSpread = false;
567 id: spreadItem
598 id: spreadItem
568 objectName: "spreadItem"
599 objectName: "spreadItem"
569− anchors.fill: appContainer
600+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
570 leftMargin: root.leftMargin
601 leftMargin: root.leftMargin
571 model: root.topLevelSurfaceList
602 model: root.topLevelSurfaceList
572 spreadFlickable: floatingFlickable
603 spreadFlickable: floatingFlickable
@@ -575,6 +606,83 @@ FocusScope {
575 onLeaveSpread: {
606 onLeaveSpread: {
576 priv.goneToSpread = false;
607 priv.goneToSpread = false;
611+ id: floatingFlickable
612+ objectName: "spreadFlickable"
613+ anchors.fill: parent
615+ contentWidth: spreadItem.spreadTotalWidth
617+ function snap(toIndex) {
618+ var delegate = appRepeater.itemAt(toIndex)
619+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
620+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
621+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
622+ snapAnimation.to = floatingFlickable.contentX - offset;
623+ snapAnimation.start();
624+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
625+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
626+ snapAnimation.to = floatingFlickable.contentX - offset;
627+ snapAnimation.start();
630+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
635+ objectName: "hoverMouseArea"
636+ anchors.fill: parent
637+ propagateComposedEvents: true
642+ property int scrollAreaWidth: width / 3
643+ property bool progressiveScrollingEnabled: false
645+ onPressed: mouse.accepted = false
648+ mouse.accepted = false
650+ if (hoverMouseArea.pressed) {
654+ // Find the hovered item and mark it active
655+ for (var i = appRepeater.count - 1; i >= 0; i--) {
656+ var appDelegate = appRepeater.itemAt(i);
657+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
658+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
659+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
660+ spreadItem.highlightedIndex = i;
665+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
666+ var margins = floatingFlickable.width * 0.05;
668+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
669+ progressiveScrollingEnabled = true
672+ // do we need to scroll?
673+ if (mouseX < scrollAreaWidth + margins) {
674+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
675+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
676+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
678+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
679+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
680+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
681+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
580 Connections {
688 Connections {
@@ -669,10 +777,28 @@ FocusScope {
782+ property real previewScale: .5
783+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
785+ width: implicitWidth * height / implicitHeight
788+ opacity: surface != null ? 1 : 0
789+ Behavior on opacity { UbuntuNumberAnimation {} }
790+ visible: opacity > 0
792+ Drag.active: surface != null
793+ Drag.keys: ["application"]
673 id: boundariesForWindowPlacement
799 id: boundariesForWindowPlacement
674 anchors.fill: parent
800 anchors.fill: parent
675− anchors.topMargin: PanelState.panelHeight
801+ anchors.topMargin: panelState.panelHeight
676 visible: false
802 visible: false
@@ -704,6 +830,9 @@ FocusScope {
705 z: normalZ
831 z: normalZ
833+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
834+ Behavior on opacity { UbuntuNumberAnimation {} }
707 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
836 // 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.
837 // match what the actual surface size is.
709 // Don't write to those, they will be set by states
838 // Don't write to those, they will be set by states
@@ -765,7 +894,7 @@ FocusScope {
765 target: appDelegate
894 target: appDelegate
766 property: "y"
895 property: "y"
767 value: appDelegate.requestedY -
896 value: appDelegate.requestedY -
768− Math.min(appDelegate.requestedY - PanelState.panelHeight,
897+ Math.min(appDelegate.requestedY - panelState.panelHeight,
769 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
898 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
770 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
899 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
771 && root.inputMethodRect.height > 0
900 && root.inputMethodRect.height > 0
@@ -876,7 +1005,6 @@ FocusScope {
876 function claimFocus() {
1005 function claimFocus() {
877 if (root.state == "spread") {
1006 if (root.state == "spread") {
878 spreadItem.highlightedIndex = index
1007 spreadItem.highlightedIndex = index
879− priv.goneToSpread = false;
881 if (root.mode == "stagedWithSideStage") {
1009 if (root.mode == "stagedWithSideStage") {
882 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1010 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1163,7 +1291,7 @@ FocusScope {
1163 progress: 0
1291 progress: 0
1164 targetHeight: spreadItem.stackHeight
1292 targetHeight: spreadItem.stackHeight
1165 targetX: spreadMaths.targetX
1293 targetX: spreadMaths.targetX
1166− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1294+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1167 targetY: spreadMaths.targetY
1295 targetY: spreadMaths.targetY
1168 targetAngle: spreadMaths.targetAngle
1296 targetAngle: spreadMaths.targetAngle
1169 targetScale: spreadMaths.targetScale
1297 targetScale: spreadMaths.targetScale
@@ -1209,8 +1337,6 @@ FocusScope {
1209 y: spreadMaths.targetY
1337 y: spreadMaths.targetY
1210 z: index
1338 z: index
1211 height: spreadItem.spreadItemHeight
1339 height: spreadItem.spreadItemHeight
1212− requestedWidth: decoratedWindow.oldRequestedWidth
1213− requestedHeight: decoratedWindow.oldRequestedHeight
1214 visible: spreadMaths.itemVisible
1340 visible: spreadMaths.itemVisible
1216 PropertyChanges { target: dragArea; enabled: true }
1342 PropertyChanges { target: dragArea; enabled: true }
@@ -1230,8 +1356,6 @@ FocusScope {
1230 y: stagedRightEdgeMaths.animatedY
1356 y: stagedRightEdgeMaths.animatedY
1231 z: stagedRightEdgeMaths.animatedZ
1357 z: stagedRightEdgeMaths.animatedZ
1232 height: stagedRightEdgeMaths.animatedHeight
1358 height: stagedRightEdgeMaths.animatedHeight
1233− requestedWidth: decoratedWindow.oldRequestedWidth
1234− requestedHeight: decoratedWindow.oldRequestedHeight
1235 visible: appDelegate.x < root.width
1359 visible: appDelegate.x < root.width
1237 PropertyChanges {
1361 PropertyChanges {
@@ -1261,8 +1385,6 @@ FocusScope {
1261 y: windowedRightEdgeMaths.animatedY
1385 y: windowedRightEdgeMaths.animatedY
1262 z: windowedRightEdgeMaths.animatedZ
1386 z: windowedRightEdgeMaths.animatedZ
1263 height: stagedRightEdgeMaths.animatedHeight
1387 height: stagedRightEdgeMaths.animatedHeight
1264− requestedWidth: decoratedWindow.oldRequestedWidth
1265− requestedHeight: decoratedWindow.oldRequestedHeight
1267 PropertyChanges {
1389 PropertyChanges {
1268 target: decoratedWindow
1390 target: decoratedWindow
@@ -1284,12 +1406,16 @@ FocusScope {
1284 PropertyChanges {
1406 PropertyChanges {
1285 target: appDelegate
1407 target: appDelegate
1286 x: stageMaths.itemX
1408 x: stageMaths.itemX
1287− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1409+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1288− requestedWidth: appContainer.width
1289− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1290 visuallyMaximized: true
1410 visuallyMaximized: true
1291 visible: appDelegate.x < root.width
1411 visible: appDelegate.x < root.width
1414+ target: appDelegate
1415+ requestedWidth: appContainer.width
1416+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1417+ restoreEntryValues: false
1293 PropertyChanges {
1419 PropertyChanges {
1294 target: decoratedWindow
1420 target: decoratedWindow
1295 hasDecoration: false
1421 hasDecoration: false
@@ -1312,13 +1438,17 @@ FocusScope {
1312 PropertyChanges {
1438 PropertyChanges {
1313 target: appDelegate
1439 target: appDelegate
1314 x: stageMaths.itemX
1440 x: stageMaths.itemX
1315− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1441+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1316 z: stageMaths.itemZ
1442 z: stageMaths.itemZ
1317− requestedWidth: stageMaths.itemWidth
1318− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1319 visuallyMaximized: true
1443 visuallyMaximized: true
1320 visible: appDelegate.x < root.width
1444 visible: appDelegate.x < root.width
1447+ target: appDelegate
1448+ requestedWidth: stageMaths.itemWidth
1449+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1450+ restoreEntryValues: false
1322 PropertyChanges {
1452 PropertyChanges {
1323 target: decoratedWindow
1453 target: decoratedWindow
1324 hasDecoration: false
1454 hasDecoration: false
@@ -1336,8 +1466,12 @@ FocusScope {
1336 requestedY: 0;
1466 requestedY: 0;
1337 visuallyMinimized: false;
1467 visuallyMinimized: false;
1338 visuallyMaximized: true
1468 visuallyMaximized: true
1471+ target: appDelegate
1339− requestedWidth: appContainer.width - root.leftMargin;
1472+ requestedWidth: appContainer.width - root.leftMargin
1340− requestedHeight: appContainer.height;
1473+ requestedHeight: appContainer.height
1474+ restoreEntryValues: false
1342 PropertyChanges { target: touchControls; enabled: true }
1476 PropertyChanges { target: touchControls; enabled: true }
@@ -1347,8 +1481,12 @@ FocusScope {
1347 target: appDelegate;
1481 target: appDelegate;
1348 requestedX: 0
1482 requestedX: 0
1349 requestedY: 0
1483 requestedY: 0
1486+ target: appDelegate
1350− requestedWidth: appContainer.width;
1487+ requestedWidth: appContainer.width
1351− requestedHeight: appContainer.height;
1488+ requestedHeight: appContainer.height
1489+ restoreEntryValues: false
1353 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1491 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1363,6 +1501,12 @@ FocusScope {
1363 PropertyChanges { target: touchControls; enabled: true }
1501 PropertyChanges { target: touchControls; enabled: true }
1364 PropertyChanges { target: resizeArea; enabled: true }
1502 PropertyChanges { target: resizeArea; enabled: true }
1365 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1503 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1505+ target: appDelegate
1506+ requestedWidth: windowedWidth
1507+ requestedHeight: windowedHeight
1508+ restoreEntryValues: false
1368 name: "restored";
1512 name: "restored";
@@ -1380,9 +1524,9 @@ FocusScope {
1380 PropertyChanges {
1524 PropertyChanges {
1381 target: appDelegate
1525 target: appDelegate
1382 windowedX: root.leftMargin
1526 windowedX: root.leftMargin
1383− windowedY: PanelState.panelHeight
1527+ windowedY: panelState.panelHeight
1384 windowedWidth: (appContainer.width - root.leftMargin)/2
1528 windowedWidth: (appContainer.width - root.leftMargin)/2
1385− windowedHeight: appContainer.height - PanelState.panelHeight
1529+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1399,9 +1543,9 @@ FocusScope {
1399 PropertyChanges {
1543 PropertyChanges {
1400 target: appDelegate
1544 target: appDelegate
1401 windowedX: root.leftMargin
1545 windowedX: root.leftMargin
1402− windowedY: PanelState.panelHeight
1546+ windowedY: panelState.panelHeight
1403 windowedWidth: (appContainer.width - root.leftMargin)/2
1547 windowedWidth: (appContainer.width - root.leftMargin)/2
1404− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1548+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1418,7 +1562,7 @@ FocusScope {
1418 PropertyChanges {
1562 PropertyChanges {
1419 target: appDelegate
1563 target: appDelegate
1420 windowedX: root.leftMargin
1564 windowedX: root.leftMargin
1421− windowedY: (appContainer.height + PanelState.panelHeight)/2
1565+ windowedY: (appContainer.height + panelState.panelHeight)/2
1422 windowedWidth: (appContainer.width - root.leftMargin)/2
1566 windowedWidth: (appContainer.width - root.leftMargin)/2
1423 windowedHeight: appContainer.height/2
1567 windowedHeight: appContainer.height/2
@@ -1440,8 +1584,8 @@ FocusScope {
1441 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1585 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1442 extend: "normal"
1586 extend: "normal"
1443− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1587+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1444− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1588+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1447 name: "minimized"; when: appDelegate.minimized
1591 name: "minimized"; when: appDelegate.minimized
@@ -1456,6 +1600,10 @@ FocusScope {
1604+ print("item", index, "state changed", state)
1459 transitions: [
1607 transitions: [
1460 Transition {
1608 Transition {
1461 from: "staged,stagedWithSideStage"
1609 from: "staged,stagedWithSideStage"
@@ -1469,6 +1617,7 @@ FocusScope {
1469 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1617 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1471 Transition {
1619 Transition {
1620+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1472 to: "spread"
1621 to: "spread"
1473 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1622 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1474 PropertyAction { target: appDelegate; properties: "z,visible" }
1623 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1554,7 +1703,7 @@ FocusScope {
1556 Binding {
1705 Binding {
1557− target: PanelState
1706+ target: panelState
1558 property: "decorationsAlwaysVisible"
1707 property: "decorationsAlwaysVisible"
1559 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1708 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1575,6 +1724,7 @@ FocusScope {
1575 borderThickness: units.gu(2)
1724 borderThickness: units.gu(2)
1576 enabled: false
1725 enabled: false
1577 visible: enabled
1726 visible: enabled
1727+ readyToAssesBounds: !appDelegate._constructing
1579 onPressed: {
1729 onPressed: {
1580 appDelegate.activate();
1730 appDelegate.activate();
@@ -1598,16 +1748,11 @@ FocusScope {
1598 height: implicitHeight
1748 height: implicitHeight
1599 highlightSize: windowInfoItem.iconMargin / 2
1749 highlightSize: windowInfoItem.iconMargin / 2
1600 boundsItem: boundariesForWindowPlacement
1750 boundsItem: boundariesForWindowPlacement
1751+ panelState: root.panelState
1602 requestedWidth: appDelegate.requestedWidth
1753 requestedWidth: appDelegate.requestedWidth
1603 requestedHeight: appDelegate.requestedHeight
1754 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(); }
1756 onCloseClicked: { appDelegate.close(); }
1612 onMaximizeClicked: {
1757 onMaximizeClicked: {
1613 if (appDelegate.canBeMaximized) {
1758 if (appDelegate.canBeMaximized) {
@@ -1688,6 +1833,8 @@ FocusScope {
1688 anchors.fill: decoratedWindow
1833 anchors.fill: decoratedWindow
1689 enabled: false
1834 enabled: false
1690 closeable: !appDelegate.isDash
1835 closeable: !appDelegate.isDash
1837+ dragDelegate: fakeDragItem
1692 onClicked: {
1839 onClicked: {
1693 spreadItem.highlightedIndex = index;
1840 spreadItem.highlightedIndex = index;
@@ -1730,12 +1877,15 @@ FocusScope {
1730 objectName: "closeMouseArea"
1877 objectName: "closeMouseArea"
1731 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1878 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)
1879 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1733− visible: !appDelegate.isDash && dragArea.distance == 0
1880+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1734 && index == spreadItem.highlightedIndex
1881 && index == spreadItem.highlightedIndex
1735 && mousePos.y < (decoratedWindow.height / 3)
1882 && mousePos.y < (decoratedWindow.height / 3)
1736 && mousePos.y > -units.gu(4)
1883 && mousePos.y > -units.gu(4)
1737 && mousePos.x > -units.gu(4)
1884 && mousePos.x > -units.gu(4)
1738 && mousePos.x < (decoratedWindow.width * 2 / 3)
1885 && mousePos.x < (decoratedWindow.width * 2 / 3)
1886+ opacity: shown ? 1 : 0
1887+ visible: opacity > 0
1888+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1739 height: units.gu(6)
1889 height: units.gu(6)
1740 width: height
1890 width: height
@@ -1797,83 +1947,34 @@ FocusScope {
1797 leftMargin: root.leftMargin
1947 leftMargin: root.leftMargin
1798 appContainerWidth: appContainer.width
1948 appContainerWidth: appContainer.width
1799 appContainerHeight: appContainer.height
1949 appContainerHeight: appContainer.height
1950+ panelState: root.panelState
1802− MouseArea {
1953+ WorkspaceSwitcher {
1803− id: hoverMouseArea
1954+ id: workspaceSwitcher
1804− objectName: "hoverMouseArea"
1955+ anchors.centerIn: parent
1805− anchors.fill: appContainer
1956+ height: units.gu(20)
1806− propagateComposedEvents: true
1957+ background: root.background
1807− hoverEnabled: true
1958+ opacity: shown ? 1 : 0
1809− visible: enabled
1959+ visible: opacity > 0
1810−
1960+ Behavior on opacity { UbuntuNumberAnimation {} }
1811− property int scrollAreaWidth: width / 3
1812− property bool progressiveScrollingEnabled: false
1961+ property bool shown: false
1813−
1962+ function show() {
1814− onMouseXChanged: {
1963+ shown = true;
1815− mouse.accepted = false
1964+ hideTimer.start();
1817− if (hoverMouseArea.pressed) {
1966+ Timer {
1818− return;
1967+ id: hideTimer
1819− }
1968+ interval: 3000
1820−
1969+ onTriggered: workspaceSwitcher.shown = false;
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) {
1972+ function left() {
1864− var delegate = appRepeater.itemAt(toIndex)
1973+ show()
1865− var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1974+ }
1866− if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1975+ function right() {
1867− var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1976+ show();
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 {
1980 PropertyAnimation {