@@ -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"
@@ -349,23 +350,23 @@ FocusScope {
349 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
350 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
352− Component.onCompleted: priv.updateMainAndSideStageIndexes();
353+ Component.onCompleted: priv.updateMainAndSideStageIndexes()
354 Connections {
355 Connections {
355− target: PanelState
356+ target: panelState
356 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
357 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
357 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
358 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
358 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
359 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
361 Binding {
362 Binding {
362− target: PanelState
363+ target: panelState
363 property: "decorationsVisible"
364 property: "decorationsVisible"
364 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
365 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
367 Binding {
368 Binding {
368− target: PanelState
369+ target: panelState
369 property: "title"
370 property: "title"
371 if (priv.focusedAppDelegate !== null) {
372 if (priv.focusedAppDelegate !== null) {
@@ -380,7 +381,7 @@ FocusScope {
382 Binding {
383 Binding {
383− target: PanelState
384+ target: panelState
384 property: "focusedPersistentSurfaceId"
385 property: "focusedPersistentSurfaceId"
386 if (priv.focusedAppDelegate !== null) {
387 if (priv.focusedAppDelegate !== null) {
@@ -394,21 +395,21 @@ FocusScope {
396 Binding {
397 Binding {
397− target: PanelState
398+ target: panelState
398 property: "dropShadow"
399 property: "dropShadow"
399 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
400 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
402 Binding {
403 Binding {
403− target: PanelState
404+ target: panelState
404 property: "closeButtonShown"
405 property: "closeButtonShown"
405 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
406 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
408 Component.onDestruction: {
409 Component.onDestruction: {
409− PanelState.title = "";
410+ panelState.title = "";
410− PanelState.decorationsVisible = false;
411+ panelState.decorationsVisible = false;
411− PanelState.dropShadow = false;
412+ panelState.dropShadow = false;
414 Instantiator {
415 Instantiator {
@@ -454,6 +455,7 @@ FocusScope {
454 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
455 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
455 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
456 PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65; opacity: 1 }
456 PropertyChanges { target: wallpaper; visible: false }
457 PropertyChanges { target: wallpaper; visible: false }
458+ PropertyChanges { target: screensAndWorkspaces; opacity: 1 }
459 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
461 name: "stagedRightEdge"; when: root.spreadEnabled && (rightEdgeDragArea.dragging || rightEdgePushProgress > 0) && root.mode == "staged"
@@ -502,10 +504,13 @@ FocusScope {
502 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
504 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
503 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
505 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
504 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
506 PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
507+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
506 Transition {
509 Transition {
507 to: "spread"
510 to: "spread"
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
511 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
512+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
513+ UbuntuNumberAnimation { target: screensAndWorkspaces; property: "opacity"; duration: priv.animationDuration }
510 Transition {
515 Transition {
511 from: "spread"
516 from: "spread"
@@ -563,10 +568,21 @@ FocusScope {
563 visible: false
568 visible: false
571+ ScreensAndWorkspaces {
572+ id: screensAndWorkspaces
573+ anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
574+ height: Math.max(units.gu(30), parent.height * .3)
575+ background: root.background
577+ visible: opacity > 0
579+ onCloseSpread: priv.goneToSpread = false;
567 id: spreadItem
583 id: spreadItem
568 objectName: "spreadItem"
584 objectName: "spreadItem"
569− anchors.fill: appContainer
585+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
570 leftMargin: root.leftMargin
586 leftMargin: root.leftMargin
571 model: root.topLevelSurfaceList
587 model: root.topLevelSurfaceList
572 spreadFlickable: floatingFlickable
588 spreadFlickable: floatingFlickable
@@ -575,6 +591,83 @@ FocusScope {
575 onLeaveSpread: {
591 onLeaveSpread: {
576 priv.goneToSpread = false;
592 priv.goneToSpread = false;
596+ id: floatingFlickable
597+ objectName: "spreadFlickable"
598+ anchors.fill: parent
600+ contentWidth: spreadItem.spreadTotalWidth
602+ function snap(toIndex) {
603+ var delegate = appRepeater.itemAt(toIndex)
604+ var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
605+ if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
606+ var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
607+ snapAnimation.to = floatingFlickable.contentX - offset;
608+ snapAnimation.start();
609+ } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
610+ var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
611+ snapAnimation.to = floatingFlickable.contentX - offset;
612+ snapAnimation.start();
615+ UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
620+ objectName: "hoverMouseArea"
621+ anchors.fill: parent
622+ propagateComposedEvents: true
627+ property int scrollAreaWidth: width / 3
628+ property bool progressiveScrollingEnabled: false
630+ onPressed: mouse.accepted = false
633+ mouse.accepted = false
635+ if (hoverMouseArea.pressed) {
639+ // Find the hovered item and mark it active
640+ for (var i = appRepeater.count - 1; i >= 0; i--) {
641+ var appDelegate = appRepeater.itemAt(i);
642+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
643+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
644+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
645+ spreadItem.highlightedIndex = i;
650+ if (floatingFlickable.contentWidth > floatingFlickable.width) {
651+ var margins = floatingFlickable.width * 0.05;
653+ if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
654+ progressiveScrollingEnabled = true
657+ // do we need to scroll?
658+ if (mouseX < scrollAreaWidth + margins) {
659+ var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
660+ var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
661+ floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
663+ if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
664+ var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
665+ var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
666+ floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
580 Connections {
673 Connections {
@@ -669,10 +762,28 @@ FocusScope {
767+ property real previewScale: .5
768+ height: (screensAndWorkspaces.height - units.gu(8)) / 2
770+ width: implicitWidth * height / implicitHeight
773+ opacity: surface != null ? 1 : 0
774+ Behavior on opacity { UbuntuNumberAnimation {} }
775+ visible: opacity > 0
777+ Drag.active: surface != null
778+ Drag.keys: ["application"]
673 id: boundariesForWindowPlacement
784 id: boundariesForWindowPlacement
674 anchors.fill: parent
785 anchors.fill: parent
675− anchors.topMargin: PanelState.panelHeight
786+ anchors.topMargin: panelState.panelHeight
676 visible: false
787 visible: false
@@ -704,6 +815,9 @@ FocusScope {
705 z: normalZ
816 z: normalZ
818+ opacity: fakeDragItem.surface == model.window.surface && fakeDragItem.Drag.active ? 0 : 1
819+ Behavior on opacity { UbuntuNumberAnimation {} }
707 // Normally we want x/y where the surface thinks it is. Width/height of our delegate will
821 // 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.
822 // match what the actual surface size is.
709 // Don't write to those, they will be set by states
823 // Don't write to those, they will be set by states
@@ -765,7 +879,7 @@ FocusScope {
765 target: appDelegate
879 target: appDelegate
766 property: "y"
880 property: "y"
767 value: appDelegate.requestedY -
881 value: appDelegate.requestedY -
768− Math.min(appDelegate.requestedY - PanelState.panelHeight,
882+ Math.min(appDelegate.requestedY - panelState.panelHeight,
769 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
883 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
770 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
884 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
771 && root.inputMethodRect.height > 0
885 && root.inputMethodRect.height > 0
@@ -876,7 +990,6 @@ FocusScope {
876 function claimFocus() {
990 function claimFocus() {
877 if (root.state == "spread") {
991 if (root.state == "spread") {
878 spreadItem.highlightedIndex = index
992 spreadItem.highlightedIndex = index
879− priv.goneToSpread = false;
881 if (root.mode == "stagedWithSideStage") {
994 if (root.mode == "stagedWithSideStage") {
882 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
995 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
@@ -1163,7 +1276,7 @@ FocusScope {
1163 progress: 0
1276 progress: 0
1164 targetHeight: spreadItem.stackHeight
1277 targetHeight: spreadItem.stackHeight
1165 targetX: spreadMaths.targetX
1278 targetX: spreadMaths.targetX
1166− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1279+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1167 targetY: spreadMaths.targetY
1280 targetY: spreadMaths.targetY
1168 targetAngle: spreadMaths.targetAngle
1281 targetAngle: spreadMaths.targetAngle
1169 targetScale: spreadMaths.targetScale
1282 targetScale: spreadMaths.targetScale
@@ -1209,8 +1322,6 @@ FocusScope {
1209 y: spreadMaths.targetY
1322 y: spreadMaths.targetY
1210 z: index
1323 z: index
1211 height: spreadItem.spreadItemHeight
1324 height: spreadItem.spreadItemHeight
1212− requestedWidth: decoratedWindow.oldRequestedWidth
1213− requestedHeight: decoratedWindow.oldRequestedHeight
1214 visible: spreadMaths.itemVisible
1325 visible: spreadMaths.itemVisible
1216 PropertyChanges { target: dragArea; enabled: true }
1327 PropertyChanges { target: dragArea; enabled: true }
@@ -1230,8 +1341,6 @@ FocusScope {
1230 y: stagedRightEdgeMaths.animatedY
1341 y: stagedRightEdgeMaths.animatedY
1231 z: stagedRightEdgeMaths.animatedZ
1342 z: stagedRightEdgeMaths.animatedZ
1232 height: stagedRightEdgeMaths.animatedHeight
1343 height: stagedRightEdgeMaths.animatedHeight
1233− requestedWidth: decoratedWindow.oldRequestedWidth
1234− requestedHeight: decoratedWindow.oldRequestedHeight
1235 visible: appDelegate.x < root.width
1344 visible: appDelegate.x < root.width
1237 PropertyChanges {
1346 PropertyChanges {
@@ -1261,8 +1370,6 @@ FocusScope {
1261 y: windowedRightEdgeMaths.animatedY
1370 y: windowedRightEdgeMaths.animatedY
1262 z: windowedRightEdgeMaths.animatedZ
1371 z: windowedRightEdgeMaths.animatedZ
1263 height: stagedRightEdgeMaths.animatedHeight
1372 height: stagedRightEdgeMaths.animatedHeight
1264− requestedWidth: decoratedWindow.oldRequestedWidth
1265− requestedHeight: decoratedWindow.oldRequestedHeight
1267 PropertyChanges {
1374 PropertyChanges {
1268 target: decoratedWindow
1375 target: decoratedWindow
@@ -1284,12 +1391,16 @@ FocusScope {
1284 PropertyChanges {
1391 PropertyChanges {
1285 target: appDelegate
1392 target: appDelegate
1286 x: stageMaths.itemX
1393 x: stageMaths.itemX
1287− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1394+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1288− requestedWidth: appContainer.width
1289− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1290 visuallyMaximized: true
1395 visuallyMaximized: true
1291 visible: appDelegate.x < root.width
1396 visible: appDelegate.x < root.width
1399+ target: appDelegate
1400+ requestedWidth: appContainer.width
1401+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1402+ restoreEntryValues: false
1293 PropertyChanges {
1404 PropertyChanges {
1294 target: decoratedWindow
1405 target: decoratedWindow
1295 hasDecoration: false
1406 hasDecoration: false
@@ -1312,13 +1423,17 @@ FocusScope {
1312 PropertyChanges {
1423 PropertyChanges {
1313 target: appDelegate
1424 target: appDelegate
1314 x: stageMaths.itemX
1425 x: stageMaths.itemX
1315− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1426+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1316 z: stageMaths.itemZ
1427 z: stageMaths.itemZ
1317− requestedWidth: stageMaths.itemWidth
1318− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1319 visuallyMaximized: true
1428 visuallyMaximized: true
1320 visible: appDelegate.x < root.width
1429 visible: appDelegate.x < root.width
1432+ target: appDelegate
1433+ requestedWidth: stageMaths.itemWidth
1434+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1435+ restoreEntryValues: false
1322 PropertyChanges {
1437 PropertyChanges {
1323 target: decoratedWindow
1438 target: decoratedWindow
1324 hasDecoration: false
1439 hasDecoration: false
@@ -1336,8 +1451,12 @@ FocusScope {
1336 requestedY: 0;
1451 requestedY: 0;
1337 visuallyMinimized: false;
1452 visuallyMinimized: false;
1338 visuallyMaximized: true
1453 visuallyMaximized: true
1456+ target: appDelegate
1339− requestedWidth: appContainer.width - root.leftMargin;
1457+ requestedWidth: appContainer.width - root.leftMargin
1340− requestedHeight: appContainer.height;
1458+ requestedHeight: appContainer.height
1459+ restoreEntryValues: false
1342 PropertyChanges { target: touchControls; enabled: true }
1461 PropertyChanges { target: touchControls; enabled: true }
@@ -1347,8 +1466,12 @@ FocusScope {
1347 target: appDelegate;
1466 target: appDelegate;
1348 requestedX: 0
1467 requestedX: 0
1349 requestedY: 0
1468 requestedY: 0
1471+ target: appDelegate
1350− requestedWidth: appContainer.width;
1472+ requestedWidth: appContainer.width
1351− requestedHeight: appContainer.height;
1473+ requestedHeight: appContainer.height
1474+ restoreEntryValues: false
1353 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1476 PropertyChanges { target: decoratedWindow; hasDecoration: false }
@@ -1363,6 +1486,12 @@ FocusScope {
1363 PropertyChanges { target: touchControls; enabled: true }
1486 PropertyChanges { target: touchControls; enabled: true }
1364 PropertyChanges { target: resizeArea; enabled: true }
1487 PropertyChanges { target: resizeArea; enabled: true }
1365 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1488 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1490+ target: appDelegate
1491+ requestedWidth: windowedWidth
1492+ requestedHeight: windowedHeight
1493+ restoreEntryValues: false
1368 name: "restored";
1497 name: "restored";
@@ -1380,9 +1509,9 @@ FocusScope {
1380 PropertyChanges {
1509 PropertyChanges {
1381 target: appDelegate
1510 target: appDelegate
1382 windowedX: root.leftMargin
1511 windowedX: root.leftMargin
1383− windowedY: PanelState.panelHeight
1512+ windowedY: panelState.panelHeight
1384 windowedWidth: (appContainer.width - root.leftMargin)/2
1513 windowedWidth: (appContainer.width - root.leftMargin)/2
1385− windowedHeight: appContainer.height - PanelState.panelHeight
1514+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1399,9 +1528,9 @@ FocusScope {
1399 PropertyChanges {
1528 PropertyChanges {
1400 target: appDelegate
1529 target: appDelegate
1401 windowedX: root.leftMargin
1530 windowedX: root.leftMargin
1402− windowedY: PanelState.panelHeight
1531+ windowedY: panelState.panelHeight
1403 windowedWidth: (appContainer.width - root.leftMargin)/2
1532 windowedWidth: (appContainer.width - root.leftMargin)/2
1404− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1533+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1418,7 +1547,7 @@ FocusScope {
1418 PropertyChanges {
1547 PropertyChanges {
1419 target: appDelegate
1548 target: appDelegate
1420 windowedX: root.leftMargin
1549 windowedX: root.leftMargin
1421− windowedY: (appContainer.height + PanelState.panelHeight)/2
1550+ windowedY: (appContainer.height + panelState.panelHeight)/2
1422 windowedWidth: (appContainer.width - root.leftMargin)/2
1551 windowedWidth: (appContainer.width - root.leftMargin)/2
1423 windowedHeight: appContainer.height/2
1552 windowedHeight: appContainer.height/2
@@ -1440,8 +1569,8 @@ FocusScope {
1441 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1570 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1442 extend: "normal"
1571 extend: "normal"
1443− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1572+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1444− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1573+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1447 name: "minimized"; when: appDelegate.minimized
1576 name: "minimized"; when: appDelegate.minimized
@@ -1456,6 +1585,10 @@ FocusScope {
1589+ print("item", index, "state changed", state)
1459 transitions: [
1592 transitions: [
1460 Transition {
1593 Transition {
1461 from: "staged,stagedWithSideStage"
1594 from: "staged,stagedWithSideStage"
@@ -1469,6 +1602,7 @@ FocusScope {
1469 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1602 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1471 Transition {
1604 Transition {
1605+ from: "normal,restored,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,staged,stagedWithSideStage,windowedRightEdge,stagedRightEdge";
1472 to: "spread"
1606 to: "spread"
1473 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1607 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1474 PropertyAction { target: appDelegate; properties: "z,visible" }
1608 PropertyAction { target: appDelegate; properties: "z,visible" }
@@ -1554,7 +1688,7 @@ FocusScope {
1556 Binding {
1690 Binding {
1557− target: PanelState
1691+ target: panelState
1558 property: "decorationsAlwaysVisible"
1692 property: "decorationsAlwaysVisible"
1559 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1693 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1575,6 +1709,7 @@ FocusScope {
1575 borderThickness: units.gu(2)
1709 borderThickness: units.gu(2)
1576 enabled: false
1710 enabled: false
1577 visible: enabled
1711 visible: enabled
1712+ readyToAssesBounds: !appDelegate._constructing
1579 onPressed: {
1714 onPressed: {
1580 appDelegate.activate();
1715 appDelegate.activate();
@@ -1602,12 +1737,6 @@ FocusScope {
1602 requestedWidth: appDelegate.requestedWidth
1737 requestedWidth: appDelegate.requestedWidth
1603 requestedHeight: appDelegate.requestedHeight
1738 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(); }
1740 onCloseClicked: { appDelegate.close(); }
1612 onMaximizeClicked: {
1741 onMaximizeClicked: {
1613 if (appDelegate.canBeMaximized) {
1742 if (appDelegate.canBeMaximized) {
@@ -1730,12 +1859,15 @@ FocusScope {
1730 objectName: "closeMouseArea"
1859 objectName: "closeMouseArea"
1731 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1860 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)
1861 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1733− visible: !appDelegate.isDash && dragArea.distance == 0
1862+ readonly property bool shown: !appDelegate.isDash && dragArea.distance == 0
1734 && index == spreadItem.highlightedIndex
1863 && index == spreadItem.highlightedIndex
1735 && mousePos.y < (decoratedWindow.height / 3)
1864 && mousePos.y < (decoratedWindow.height / 3)
1736 && mousePos.y > -units.gu(4)
1865 && mousePos.y > -units.gu(4)
1737 && mousePos.x > -units.gu(4)
1866 && mousePos.x > -units.gu(4)
1738 && mousePos.x < (decoratedWindow.width * 2 / 3)
1867 && mousePos.x < (decoratedWindow.width * 2 / 3)
1868+ opacity: shown ? 1 : 0
1869+ visible: opacity > 0
1870+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
1739 height: units.gu(6)
1871 height: units.gu(6)
1740 width: height
1872 width: height
@@ -1797,83 +1929,7 @@ FocusScope {
1797 leftMargin: root.leftMargin
1929 leftMargin: root.leftMargin
1798 appContainerWidth: appContainer.width
1930 appContainerWidth: appContainer.width
1799 appContainerHeight: appContainer.height
1931 appContainerHeight: appContainer.height
1800− }
1932+ panelState: root.panelState
1804− objectName: "hoverMouseArea"
1805− anchors.fill: appContainer
1806− propagateComposedEvents: 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 {
1935 PropertyAnimation {