@@ -46,6 +46,7 @@ FocusScope {
4646 property int leftMargin: 0
4747 property bool oskEnabled: false
4848 property rect inputMethodRect
49+ property PanelState panelState
4950
5051 // Configuration
5152 property string mode: "staged"
@@ -348,20 +349,20 @@ FocusScope {
348349 Component.onCompleted: priv.updateMainAndSideStageIndexes();
349350
350351 Connections {
351− target: PanelState
352+ target: panelState
352353 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
353354 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestMinimize(); } }
354355 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.requestRestore(); } }
355356 }
356357
357358 Binding {
358− target: PanelState
359+ target: panelState
359360 property: "decorationsVisible"
360361 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
361362 }
362363
363364 Binding {
364− target: PanelState
365+ target: panelState
365366 property: "title"
366367 value: {
367368 if (priv.focusedAppDelegate !== null) {
@@ -376,7 +377,7 @@ FocusScope {
376377 }
377378
378379 Binding {
379− target: PanelState
380+ target: panelState
380381 property: "focusedPersistentSurfaceId"
381382 value: {
382383 if (priv.focusedAppDelegate !== null) {
@@ -390,21 +391,21 @@ FocusScope {
390391 }
391392
392393 Binding {
393− target: PanelState
394+ target: panelState
394395 property: "dropShadow"
395396 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
396397 }
397398
398399 Binding {
399− target: PanelState
400+ target: panelState
400401 property: "closeButtonShown"
401402 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
402403 }
403404
404405 Component.onDestruction: {
405− PanelState.title = "";
406− PanelState.decorationsVisible = false;
407− PanelState.dropShadow = false;
406+ panelState.title = "";
407+ panelState.decorationsVisible = false;
408+ panelState.dropShadow = false;
408409 }
409410
410411 Instantiator {
@@ -753,7 +754,7 @@ FocusScope {
753754 target: appDelegate
754755 property: "y"
755756 value: appDelegate.requestedY -
756− Math.min(appDelegate.requestedY - PanelState.panelHeight,
757+ Math.min(appDelegate.requestedY - panelState.panelHeight,
757758 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
758759 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
759760 && root.inputMethodRect.height > 0
@@ -890,7 +891,7 @@ FocusScope {
890891 screenWidth: appContainer.width
891892 screenHeight: appContainer.height
892893 leftMargin: root.leftMargin
893− minimumY: PanelState.panelHeight
894+ minimumY: panelState.panelHeight
894895 }
895896
896897 Connections {
@@ -1130,7 +1131,7 @@ FocusScope {
11301131 progress: 0
11311132 targetHeight: spreadItem.stackHeight
11321133 targetX: spreadMaths.targetX
1133− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1134+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
11341135 targetY: spreadMaths.targetY
11351136 targetAngle: spreadMaths.targetAngle
11361137 targetScale: spreadMaths.targetScale
@@ -1249,9 +1250,9 @@ FocusScope {
12491250 PropertyChanges {
12501251 target: appDelegate
12511252 x: stageMaths.itemX
1252− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1253+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12531254 requestedWidth: appContainer.width
1254− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1255+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12551256 visuallyMaximized: true
12561257 visible: appDelegate.x < root.width
12571258 }
@@ -1277,10 +1278,10 @@ FocusScope {
12771278 PropertyChanges {
12781279 target: appDelegate
12791280 x: stageMaths.itemX
1280− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1281+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12811282 z: stageMaths.itemZ
12821283 requestedWidth: stageMaths.itemWidth
1283− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1284+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12841285 visuallyMaximized: true
12851286 visible: appDelegate.x < root.width
12861287 }
@@ -1345,9 +1346,9 @@ FocusScope {
13451346 PropertyChanges {
13461347 target: appDelegate
13471348 windowedX: root.leftMargin
1348− windowedY: PanelState.panelHeight
1349+ windowedY: panelState.panelHeight
13491350 windowedWidth: (appContainer.width - root.leftMargin)/2
1350− windowedHeight: appContainer.height - PanelState.panelHeight
1351+ windowedHeight: appContainer.height - panelState.panelHeight
13511352 }
13521353 },
13531354 State {
@@ -1364,9 +1365,9 @@ FocusScope {
13641365 PropertyChanges {
13651366 target: appDelegate
13661367 windowedX: root.leftMargin
1367− windowedY: PanelState.panelHeight
1368+ windowedY: panelState.panelHeight
13681369 windowedWidth: (appContainer.width - root.leftMargin)/2
1369− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1370+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
13701371 }
13711372 },
13721373 State {
@@ -1383,7 +1384,7 @@ FocusScope {
13831384 PropertyChanges {
13841385 target: appDelegate
13851386 windowedX: root.leftMargin
1386− windowedY: (appContainer.height + PanelState.panelHeight)/2
1387+ windowedY: (appContainer.height + panelState.panelHeight)/2
13871388 windowedWidth: (appContainer.width - root.leftMargin)/2
13881389 windowedHeight: appContainer.height/2
13891390 }
@@ -1405,8 +1406,8 @@ FocusScope {
14051406 State {
14061407 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
14071408 extend: "normal"
1408− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1409− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1409+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1410+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
14101411 },
14111412 State {
14121413 name: "minimized"; when: appDelegate.minimized
@@ -1505,7 +1506,7 @@ FocusScope {
15051506 ]
15061507
15071508 Binding {
1508− target: PanelState
1509+ target: panelState
15091510 property: "decorationsAlwaysVisible"
15101511 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
15111512 }
@@ -1520,7 +1521,7 @@ FocusScope {
15201521 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
15211522
15221523 target: appDelegate
1523− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1524+ minimumY: panelState.panelHeight // disallow resizing up past Panel
15241525 minWidth: units.gu(10)
15251526 minHeight: units.gu(10)
15261527 borderThickness: units.gu(2)
@@ -1550,6 +1551,7 @@ FocusScope {
15501551 highlightSize: windowInfoItem.iconMargin / 2
15511552 stageWidth: appContainer.width
15521553 stageHeight: appContainer.height
1554+ panelState: root.panelState
15531555
15541556 requestedWidth: appDelegate.requestedWidth
15551557 requestedHeight: appDelegate.requestedHeight
@@ -1609,6 +1611,7 @@ FocusScope {
16091611 visible: enabled
16101612 stageWidth: appContainer.width
16111613 stageHeight: appContainer.height
1614+ panelState: root.panelState
16121615
16131616 onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
16141617 onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
@@ -1713,6 +1716,7 @@ FocusScope {
17131716 leftMargin: root.leftMargin
17141717 appContainerWidth: appContainer.width
17151718 appContainerHeight: appContainer.height
1719+ panelState: root.panelState
17161720 }
17171721
17181722 EdgeBarrier {