@@ -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: "buttonsVisible"
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,21 +377,21 @@ FocusScope {
376377 }
377378
378379 Binding {
379− target: PanelState
380+ target: panelState
380381 property: "dropShadow"
381382 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
382383 }
383384
384385 Binding {
385− target: PanelState
386+ target: panelState
386387 property: "closeButtonShown"
387388 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
388389 }
389390
390391 Component.onDestruction: {
391− PanelState.title = "";
392− PanelState.buttonsVisible = false;
393− PanelState.dropShadow = false;
392+ panelState.title = "";
393+ panelState.buttonsVisible = false;
394+ panelState.dropShadow = false;
394395 }
395396
396397 Instantiator {
@@ -739,7 +740,7 @@ FocusScope {
739740 target: appDelegate
740741 property: "y"
741742 value: appDelegate.requestedY -
742− Math.min(appDelegate.requestedY - PanelState.panelHeight,
743+ Math.min(appDelegate.requestedY - panelState.panelHeight,
743744 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
744745 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
745746 && root.inputMethodRect.height > 0
@@ -876,7 +877,7 @@ FocusScope {
876877 screenWidth: appContainer.width
877878 screenHeight: appContainer.height
878879 leftMargin: root.leftMargin
879− minimumY: PanelState.panelHeight
880+ minimumY: panelState.panelHeight
880881 }
881882
882883 Connections {
@@ -1116,7 +1117,7 @@ FocusScope {
11161117 progress: 0
11171118 targetHeight: spreadItem.stackHeight
11181119 targetX: spreadMaths.targetX
1119− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1120+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
11201121 targetY: spreadMaths.targetY
11211122 targetAngle: spreadMaths.targetAngle
11221123 targetScale: spreadMaths.targetScale
@@ -1235,9 +1236,9 @@ FocusScope {
12351236 PropertyChanges {
12361237 target: appDelegate
12371238 x: stageMaths.itemX
1238− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1239+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12391240 requestedWidth: appContainer.width
1240− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1241+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12411242 visuallyMaximized: true
12421243 visible: appDelegate.x < root.width
12431244 }
@@ -1263,10 +1264,10 @@ FocusScope {
12631264 PropertyChanges {
12641265 target: appDelegate
12651266 x: stageMaths.itemX
1266− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1267+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
12671268 z: stageMaths.itemZ
12681269 requestedWidth: stageMaths.itemWidth
1269− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1270+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
12701271 visuallyMaximized: true
12711272 visible: appDelegate.x < root.width
12721273 }
@@ -1331,9 +1332,9 @@ FocusScope {
13311332 PropertyChanges {
13321333 target: appDelegate
13331334 windowedX: root.leftMargin
1334− windowedY: PanelState.panelHeight
1335+ windowedY: panelState.panelHeight
13351336 windowedWidth: (appContainer.width - root.leftMargin)/2
1336− windowedHeight: appContainer.height - PanelState.panelHeight
1337+ windowedHeight: appContainer.height - panelState.panelHeight
13371338 }
13381339 },
13391340 State {
@@ -1350,9 +1351,9 @@ FocusScope {
13501351 PropertyChanges {
13511352 target: appDelegate
13521353 windowedX: root.leftMargin
1353− windowedY: PanelState.panelHeight
1354+ windowedY: panelState.panelHeight
13541355 windowedWidth: (appContainer.width - root.leftMargin)/2
1355− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1356+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
13561357 }
13571358 },
13581359 State {
@@ -1369,7 +1370,7 @@ FocusScope {
13691370 PropertyChanges {
13701371 target: appDelegate
13711372 windowedX: root.leftMargin
1372− windowedY: (appContainer.height + PanelState.panelHeight)/2
1373+ windowedY: (appContainer.height + panelState.panelHeight)/2
13731374 windowedWidth: (appContainer.width - root.leftMargin)/2
13741375 windowedHeight: appContainer.height/2
13751376 }
@@ -1391,8 +1392,8 @@ FocusScope {
13911392 State {
13921393 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
13931394 extend: "normal"
1394− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1395− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1395+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1396+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
13961397 },
13971398 State {
13981399 name: "minimized"; when: appDelegate.minimized
@@ -1491,7 +1492,7 @@ FocusScope {
14911492 ]
14921493
14931494 Binding {
1494− target: PanelState
1495+ target: panelState
14951496 property: "buttonsAlwaysVisible"
14961497 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
14971498 }
@@ -1506,7 +1507,7 @@ FocusScope {
15061507 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
15071508
15081509 target: appDelegate
1509− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1510+ minimumY: panelState.panelHeight // disallow resizing up past Panel
15101511 minWidth: units.gu(10)
15111512 minHeight: units.gu(10)
15121513 borderThickness: units.gu(2)
@@ -1699,6 +1700,7 @@ FocusScope {
16991700 leftMargin: root.leftMargin
17001701 appContainerWidth: appContainer.width
17011702 appContainerHeight: appContainer.height
1703+ panelState: root.panelState
17021704 }
17031705
17041706 EdgeBarrier {