@@ -46,6 +46,7 @@ FocusScope {
46 property int leftMargin: 0
46 property int leftMargin: 0
47 property bool oskEnabled: false
47 property bool oskEnabled: false
48 property rect inputMethodRect
48 property rect inputMethodRect
49+ property PanelState panelState
50 // Configuration
51 // Configuration
51 property string mode: "staged"
52 property string mode: "staged"
@@ -348,20 +349,20 @@ FocusScope {
348 Component.onCompleted: priv.updateMainAndSideStageIndexes();
349 Component.onCompleted: priv.updateMainAndSideStageIndexes();
350 Connections {
351 Connections {
351− target: PanelState
352+ target: panelState
352 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
355 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
357 Binding {
358 Binding {
358− target: PanelState
359+ target: panelState
359 property: "buttonsVisible"
360 property: "buttonsVisible"
360 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
361 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
363 Binding {
364 Binding {
364− target: PanelState
365+ target: panelState
365 property: "title"
366 property: "title"
367 if (priv.focusedAppDelegate !== null) {
368 if (priv.focusedAppDelegate !== null) {
@@ -376,21 +377,21 @@ FocusScope {
378 Binding {
379 Binding {
379− target: PanelState
380+ target: panelState
380 property: "dropShadow"
381 property: "dropShadow"
381 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
382 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
384 Binding {
385 Binding {
385− target: PanelState
386+ target: panelState
386 property: "closeButtonShown"
387 property: "closeButtonShown"
387 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
388 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
390 Component.onDestruction: {
391 Component.onDestruction: {
391− PanelState.title = "";
392+ panelState.title = "";
392− PanelState.buttonsVisible = false;
393+ panelState.buttonsVisible = false;
393− PanelState.dropShadow = false;
394+ panelState.dropShadow = false;
396 Instantiator {
397 Instantiator {
@@ -468,7 +469,7 @@ FocusScope {
470 name: "staged"; when: root.mode === "staged"
471 name: "staged"; when: root.mode === "staged"
471− PropertyChanges { target: wallpaper; visible: false }
472+ PropertyChanges { target: wallpaper; visible: priv.focusedAppDelegate && priv.focusedAppDelegate.x === 0 }
474 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
475 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
@@ -545,10 +546,16 @@ FocusScope {
545 visible: false
546 visible: false
549+ ScreensAndWorkspaces {
550+ id: screensAndWorkspaces
551+ anchors { left: parent.left; top: parent.top; right: parent.right }
552+ height: parent.height / 3
549 id: spreadItem
556 id: spreadItem
550 objectName: "spreadItem"
557 objectName: "spreadItem"
551− anchors.fill: appContainer
558+ anchors { left: parent.left; bottom: parent.bottom; right: parent.right; top: screensAndWorkspaces.bottom }
552 leftMargin: root.leftMargin
559 leftMargin: root.leftMargin
553 model: root.topLevelSurfaceList
560 model: root.topLevelSurfaceList
554 spreadFlickable: floatingFlickable
561 spreadFlickable: floatingFlickable
@@ -739,7 +746,7 @@ FocusScope {
739 target: appDelegate
746 target: appDelegate
740 property: "y"
747 property: "y"
741 value: appDelegate.requestedY -
748 value: appDelegate.requestedY -
742− Math.min(appDelegate.requestedY - PanelState.panelHeight,
749+ Math.min(appDelegate.requestedY - panelState.panelHeight,
743 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
750 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
744 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
751 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
745 && root.inputMethodRect.height > 0
752 && root.inputMethodRect.height > 0
@@ -876,7 +883,7 @@ FocusScope {
876 screenWidth: appContainer.width
883 screenWidth: appContainer.width
877 screenHeight: appContainer.height
884 screenHeight: appContainer.height
878 leftMargin: root.leftMargin
885 leftMargin: root.leftMargin
879− minimumY: PanelState.panelHeight
886+ minimumY: panelState.panelHeight
882 Connections {
889 Connections {
@@ -1116,7 +1123,7 @@ FocusScope {
1116 progress: 0
1123 progress: 0
1117 targetHeight: spreadItem.stackHeight
1124 targetHeight: spreadItem.stackHeight
1118 targetX: spreadMaths.targetX
1125 targetX: spreadMaths.targetX
1119− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1126+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1120 targetY: spreadMaths.targetY
1127 targetY: spreadMaths.targetY
1121 targetAngle: spreadMaths.targetAngle
1128 targetAngle: spreadMaths.targetAngle
1122 targetScale: spreadMaths.targetScale
1129 targetScale: spreadMaths.targetScale
@@ -1235,9 +1242,9 @@ FocusScope {
1235 PropertyChanges {
1242 PropertyChanges {
1236 target: appDelegate
1243 target: appDelegate
1237 x: stageMaths.itemX
1244 x: stageMaths.itemX
1238− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1245+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1239 requestedWidth: appContainer.width
1246 requestedWidth: appContainer.width
1240− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1247+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1241 visuallyMaximized: true
1248 visuallyMaximized: true
1242 visible: appDelegate.x < root.width
1249 visible: appDelegate.x < root.width
@@ -1263,10 +1270,10 @@ FocusScope {
1263 PropertyChanges {
1270 PropertyChanges {
1264 target: appDelegate
1271 target: appDelegate
1265 x: stageMaths.itemX
1272 x: stageMaths.itemX
1266− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1273+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1267 z: stageMaths.itemZ
1274 z: stageMaths.itemZ
1268 requestedWidth: stageMaths.itemWidth
1275 requestedWidth: stageMaths.itemWidth
1269− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1276+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1270 visuallyMaximized: true
1277 visuallyMaximized: true
1271 visible: appDelegate.x < root.width
1278 visible: appDelegate.x < root.width
@@ -1331,9 +1338,9 @@ FocusScope {
1331 PropertyChanges {
1338 PropertyChanges {
1332 target: appDelegate
1339 target: appDelegate
1333 windowedX: root.leftMargin
1340 windowedX: root.leftMargin
1334− windowedY: PanelState.panelHeight
1341+ windowedY: panelState.panelHeight
1335 windowedWidth: (appContainer.width - root.leftMargin)/2
1342 windowedWidth: (appContainer.width - root.leftMargin)/2
1336− windowedHeight: appContainer.height - PanelState.panelHeight
1343+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1350,9 +1357,9 @@ FocusScope {
1350 PropertyChanges {
1357 PropertyChanges {
1351 target: appDelegate
1358 target: appDelegate
1352 windowedX: root.leftMargin
1359 windowedX: root.leftMargin
1353− windowedY: PanelState.panelHeight
1360+ windowedY: panelState.panelHeight
1354 windowedWidth: (appContainer.width - root.leftMargin)/2
1361 windowedWidth: (appContainer.width - root.leftMargin)/2
1355− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1362+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1369,7 +1376,7 @@ FocusScope {
1369 PropertyChanges {
1376 PropertyChanges {
1370 target: appDelegate
1377 target: appDelegate
1371 windowedX: root.leftMargin
1378 windowedX: root.leftMargin
1372− windowedY: (appContainer.height + PanelState.panelHeight)/2
1379+ windowedY: (appContainer.height + panelState.panelHeight)/2
1373 windowedWidth: (appContainer.width - root.leftMargin)/2
1380 windowedWidth: (appContainer.width - root.leftMargin)/2
1374 windowedHeight: appContainer.height/2
1381 windowedHeight: appContainer.height/2
@@ -1391,8 +1398,8 @@ FocusScope {
1392 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1399 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1393 extend: "normal"
1400 extend: "normal"
1394− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1401+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1395− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1402+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1398 name: "minimized"; when: appDelegate.minimized
1405 name: "minimized"; when: appDelegate.minimized
@@ -1491,7 +1498,7 @@ FocusScope {
1493 Binding {
1500 Binding {
1494− target: PanelState
1501+ target: panelState
1495 property: "buttonsAlwaysVisible"
1502 property: "buttonsAlwaysVisible"
1496 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1503 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1506,7 +1513,7 @@ FocusScope {
1506 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1513 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1508 target: appDelegate
1515 target: appDelegate
1509− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1516+ minimumY: panelState.panelHeight // disallow resizing up past Panel
1510 minWidth: units.gu(10)
1517 minWidth: units.gu(10)
1511 minHeight: units.gu(10)
1518 minHeight: units.gu(10)
1512 borderThickness: units.gu(2)
1519 borderThickness: units.gu(2)
@@ -1536,6 +1543,7 @@ FocusScope {
1536 highlightSize: windowInfoItem.iconMargin / 2
1543 highlightSize: windowInfoItem.iconMargin / 2
1537 stageWidth: appContainer.width
1544 stageWidth: appContainer.width
1538 stageHeight: appContainer.height
1545 stageHeight: appContainer.height
1546+ panelState: root.panelState
1540 requestedWidth: appDelegate.requestedWidth
1548 requestedWidth: appDelegate.requestedWidth
1541 requestedHeight: appDelegate.requestedHeight
1549 requestedHeight: appDelegate.requestedHeight
@@ -1595,6 +1603,7 @@ FocusScope {
1595 visible: enabled
1603 visible: enabled
1596 stageWidth: appContainer.width
1604 stageWidth: appContainer.width
1597 stageHeight: appContainer.height
1605 stageHeight: appContainer.height
1606+ panelState: root.panelState
1599 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1608 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1600 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
1609 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1699,6 +1708,7 @@ FocusScope {
1699 leftMargin: root.leftMargin
1708 leftMargin: root.leftMargin
1700 appContainerWidth: appContainer.width
1709 appContainerWidth: appContainer.width
1701 appContainerHeight: appContainer.height
1710 appContainerHeight: appContainer.height
1711+ panelState: root.panelState
1704 EdgeBarrier {
1714 EdgeBarrier {