@@ -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: "decorationsVisible"
360 property: "decorationsVisible"
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,7 +377,7 @@ FocusScope {
378 Binding {
379 Binding {
379− target: PanelState
380+ target: panelState
380 property: "focusedPersistentSurfaceId"
381 property: "focusedPersistentSurfaceId"
382 if (priv.focusedAppDelegate !== null) {
383 if (priv.focusedAppDelegate !== null) {
@@ -390,21 +391,21 @@ FocusScope {
392 Binding {
393 Binding {
393− target: PanelState
394+ target: panelState
394 property: "dropShadow"
395 property: "dropShadow"
395 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
396 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
398 Binding {
399 Binding {
399− target: PanelState
400+ target: panelState
400 property: "closeButtonShown"
401 property: "closeButtonShown"
401 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
402 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
404 Component.onDestruction: {
405 Component.onDestruction: {
405− PanelState.title = "";
406+ panelState.title = "";
406− PanelState.decorationsVisible = false;
407+ panelState.decorationsVisible = false;
407− PanelState.dropShadow = false;
408+ panelState.dropShadow = false;
410 Instantiator {
411 Instantiator {
@@ -753,7 +754,7 @@ FocusScope {
753 target: appDelegate
754 target: appDelegate
754 property: "y"
755 property: "y"
755 value: appDelegate.requestedY -
756 value: appDelegate.requestedY -
756− Math.min(appDelegate.requestedY - PanelState.panelHeight,
757+ Math.min(appDelegate.requestedY - panelState.panelHeight,
757 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
758 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
758 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
759 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
759 && root.inputMethodRect.height > 0
760 && root.inputMethodRect.height > 0
@@ -890,7 +891,7 @@ FocusScope {
890 screenWidth: appContainer.width
891 screenWidth: appContainer.width
891 screenHeight: appContainer.height
892 screenHeight: appContainer.height
892 leftMargin: root.leftMargin
893 leftMargin: root.leftMargin
893− minimumY: PanelState.panelHeight
894+ minimumY: panelState.panelHeight
896 Connections {
897 Connections {
@@ -1130,7 +1131,7 @@ FocusScope {
1130 progress: 0
1131 progress: 0
1131 targetHeight: spreadItem.stackHeight
1132 targetHeight: spreadItem.stackHeight
1132 targetX: spreadMaths.targetX
1133 targetX: spreadMaths.targetX
1133− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1134+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1134 targetY: spreadMaths.targetY
1135 targetY: spreadMaths.targetY
1135 targetAngle: spreadMaths.targetAngle
1136 targetAngle: spreadMaths.targetAngle
1136 targetScale: spreadMaths.targetScale
1137 targetScale: spreadMaths.targetScale
@@ -1249,9 +1250,9 @@ FocusScope {
1249 PropertyChanges {
1250 PropertyChanges {
1250 target: appDelegate
1251 target: appDelegate
1251 x: stageMaths.itemX
1252 x: stageMaths.itemX
1252− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1253+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1253 requestedWidth: appContainer.width
1254 requestedWidth: appContainer.width
1254− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1255+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1255 visuallyMaximized: true
1256 visuallyMaximized: true
1256 visible: appDelegate.x < root.width
1257 visible: appDelegate.x < root.width
@@ -1277,10 +1278,10 @@ FocusScope {
1277 PropertyChanges {
1278 PropertyChanges {
1278 target: appDelegate
1279 target: appDelegate
1279 x: stageMaths.itemX
1280 x: stageMaths.itemX
1280− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1281+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1281 z: stageMaths.itemZ
1282 z: stageMaths.itemZ
1282 requestedWidth: stageMaths.itemWidth
1283 requestedWidth: stageMaths.itemWidth
1283− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1284+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1284 visuallyMaximized: true
1285 visuallyMaximized: true
1285 visible: appDelegate.x < root.width
1286 visible: appDelegate.x < root.width
@@ -1345,9 +1346,9 @@ FocusScope {
1345 PropertyChanges {
1346 PropertyChanges {
1346 target: appDelegate
1347 target: appDelegate
1347 windowedX: root.leftMargin
1348 windowedX: root.leftMargin
1348− windowedY: PanelState.panelHeight
1349+ windowedY: panelState.panelHeight
1349 windowedWidth: (appContainer.width - root.leftMargin)/2
1350 windowedWidth: (appContainer.width - root.leftMargin)/2
1350− windowedHeight: appContainer.height - PanelState.panelHeight
1351+ windowedHeight: appContainer.height - panelState.panelHeight
@@ -1364,9 +1365,9 @@ FocusScope {
1364 PropertyChanges {
1365 PropertyChanges {
1365 target: appDelegate
1366 target: appDelegate
1366 windowedX: root.leftMargin
1367 windowedX: root.leftMargin
1367− windowedY: PanelState.panelHeight
1368+ windowedY: panelState.panelHeight
1368 windowedWidth: (appContainer.width - root.leftMargin)/2
1369 windowedWidth: (appContainer.width - root.leftMargin)/2
1369− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1370+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
@@ -1383,7 +1384,7 @@ FocusScope {
1383 PropertyChanges {
1384 PropertyChanges {
1384 target: appDelegate
1385 target: appDelegate
1385 windowedX: root.leftMargin
1386 windowedX: root.leftMargin
1386− windowedY: (appContainer.height + PanelState.panelHeight)/2
1387+ windowedY: (appContainer.height + panelState.panelHeight)/2
1387 windowedWidth: (appContainer.width - root.leftMargin)/2
1388 windowedWidth: (appContainer.width - root.leftMargin)/2
1388 windowedHeight: appContainer.height/2
1389 windowedHeight: appContainer.height/2
@@ -1405,8 +1406,8 @@ FocusScope {
1406 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1407 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1407 extend: "normal"
1408 extend: "normal"
1408− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1409+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1409− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1410+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1412 name: "minimized"; when: appDelegate.minimized
1413 name: "minimized"; when: appDelegate.minimized
@@ -1505,7 +1506,7 @@ FocusScope {
1507 Binding {
1508 Binding {
1508− target: PanelState
1509+ target: panelState
1509 property: "decorationsAlwaysVisible"
1510 property: "decorationsAlwaysVisible"
1510 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1511 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -1520,7 +1521,7 @@ FocusScope {
1520 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1521 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1522 target: appDelegate
1523 target: appDelegate
1523− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1524+ minimumY: panelState.panelHeight // disallow resizing up past Panel
1524 minWidth: units.gu(10)
1525 minWidth: units.gu(10)
1525 minHeight: units.gu(10)
1526 minHeight: units.gu(10)
1526 borderThickness: units.gu(2)
1527 borderThickness: units.gu(2)
@@ -1550,6 +1551,7 @@ FocusScope {
1550 highlightSize: windowInfoItem.iconMargin / 2
1551 highlightSize: windowInfoItem.iconMargin / 2
1551 stageWidth: appContainer.width
1552 stageWidth: appContainer.width
1552 stageHeight: appContainer.height
1553 stageHeight: appContainer.height
1554+ panelState: root.panelState
1554 requestedWidth: appDelegate.requestedWidth
1556 requestedWidth: appDelegate.requestedWidth
1555 requestedHeight: appDelegate.requestedHeight
1557 requestedHeight: appDelegate.requestedHeight
@@ -1609,6 +1611,7 @@ FocusScope {
1609 visible: enabled
1611 visible: enabled
1610 stageWidth: appContainer.width
1612 stageWidth: appContainer.width
1611 stageHeight: appContainer.height
1613 stageHeight: appContainer.height
1614+ panelState: root.panelState
1613 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1616 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
1614 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
1617 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1713,6 +1716,7 @@ FocusScope {
1713 leftMargin: root.leftMargin
1716 leftMargin: root.leftMargin
1714 appContainerWidth: appContainer.width
1717 appContainerWidth: appContainer.width
1715 appContainerHeight: appContainer.height
1718 appContainerHeight: appContainer.height
1719+ panelState: root.panelState
1718 EdgeBarrier {
1722 EdgeBarrier {