on xenial help sign in
per shell panel state
795acacNick Dedekind
qml/Components/PanelState/PanelState.qml−1
@@ -14,7 +14,6 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−pragma Singleton
18import QtQuick 2.4
17import QtQuick 2.4
19
18
20QtObject {
19QtObject {
qml/Components/PanelState/qmldir+1−1
@@ -1 +1 @@
1−singleton PanelState 1.0 PanelState.qml
1+PanelState 1.0 PanelState.qml
qml/Greeter/SecondaryGreeter.qml+2−2
@@ -33,8 +33,8 @@ Showable {
33 property string lockedApp: ""
33 property string lockedApp: ""
34
34
35 function forceShow() { show(); }
35 function forceShow() { show(); }
36− property var notifyAboutToFocusApp: (function(appId) { return; })
36+ property var notifyAppFocusRequested: (function(appId) { return; })
37− property var notifyAppFocused: (function(appId) { return; })
37+ property var notifyUserRequestedApp: (function(appId) { return; })
38 property var notifyShowingDashFromDrag: (function(appId) { return false; })
38 property var notifyShowingDashFromDrag: (function(appId) { return false; })
39
39
40 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
40 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
qml/Panel/Panel.qml+11−10
@@ -29,6 +29,7 @@ Item {
29 property bool fullscreenMode: false
29 property bool fullscreenMode: false
30 property real indicatorAreaShowProgress: 1.0
30 property real indicatorAreaShowProgress: 1.0
31 property bool locked: false
31 property bool locked: false
32+ property PanelState panelState
32
33
33 MouseArea {
34 MouseArea {
34 anchors.fill: parent
35 anchors.fill: parent
@@ -40,7 +41,7 @@ Item {
40 }
41 }
41
42
42 Binding {
43 Binding {
43− target: PanelState
44+ target: panelState
44 property: "panelHeight"
45 property: "panelHeight"
45 value: indicators.minimizedPanelHeight
46 value: indicators.minimizedPanelHeight
46 }
47 }
@@ -74,7 +75,7 @@ Item {
74 fill: indicatorAreaBackground
75 fill: indicatorAreaBackground
75 bottomMargin: -units.gu(1)
76 bottomMargin: -units.gu(1)
76 }
77 }
77− visible: PanelState.dropShadow && !callHint.visible
78+ visible: panelState.dropShadow && !callHint.visible
78 source: "graphics/rectangular_dropshadow.sci"
79 source: "graphics/rectangular_dropshadow.sci"
79 }
80 }
80
81
@@ -120,14 +121,14 @@ Item {
120 }
121 }
121 height: indicators.minimizedPanelHeight
122 height: indicators.minimizedPanelHeight
122
123
123− visible: ((PanelState.buttonsVisible && parent.containsMouse) || PanelState.buttonsAlwaysVisible)
124+ visible: ((panelState.buttonsVisible && parent.containsMouse) || panelState.buttonsAlwaysVisible)
124 && !root.locked && !callHint.visible
125 && !root.locked && !callHint.visible
125− active: PanelState.buttonsVisible || PanelState.buttonsAlwaysVisible
126+ active: panelState.buttonsVisible || panelState.buttonsAlwaysVisible
126 windowIsMaximized: true
127 windowIsMaximized: true
127− onCloseClicked: PanelState.closeClicked()
128+ onCloseClicked: panelState.closeClicked()
128− onMinimizeClicked: PanelState.minimizeClicked()
129+ onMinimizeClicked: panelState.minimizeClicked()
129− onMaximizeClicked: PanelState.restoreClicked()
130+ onMaximizeClicked: panelState.restoreClicked()
130− closeButtonShown: PanelState.closeButtonShown
131+ closeButtonShown: panelState.closeButtonShown
131 }
132 }
132 }
133 }
133
134
@@ -181,8 +182,8 @@ Item {
181 visible: opacity != 0
182 visible: opacity != 0
182 verticalAlignment: Text.AlignVCenter
183 verticalAlignment: Text.AlignVCenter
183 fontSize: "medium"
184 fontSize: "medium"
184− font.weight: PanelState.buttonsVisible ? Font.Light : Font.Medium
185+ font.weight: panelState.buttonsVisible ? Font.Light : Font.Medium
185− text: PanelState.title
186+ text: panelState.title
186 elide: Text.ElideRight
187 elide: Text.ElideRight
187 maximumLineCount: 1
188 maximumLineCount: 1
188 Behavior on opacity { UbuntuNumberAnimation {} }
189 Behavior on opacity { UbuntuNumberAnimation {} }
qml/Shell.qml+8
@@ -38,6 +38,7 @@ import "Notifications"
38import "Stage"
38import "Stage"
39import "Tutorial"
39import "Tutorial"
40import "Wizard"
40import "Wizard"
41+import "Components/PanelState"
41import Unity.Notifications 1.0 as NotificationBackend
42import Unity.Notifications 1.0 as NotificationBackend
42import Unity.Session 0.1
43import Unity.Session 0.1
43import Unity.DashCommunicator 0.1
44import Unity.DashCommunicator 0.1
@@ -257,6 +258,11 @@ StyledItem {
257 schema.id: "com.canonical.Unity8"
258 schema.id: "com.canonical.Unity8"
258 }
259 }
259
260
261+ PanelState {
262+ id: panelState
263+ objectName: "panelState"
264+ }
265+
260 Item {
266 Item {
261 id: stages
267 id: stages
262 objectName: "stages"
268 objectName: "stages"
@@ -312,6 +318,7 @@ StyledItem {
312 altTabPressed: physicalKeysMapper.altTabPressed
318 altTabPressed: physicalKeysMapper.altTabPressed
313 oskEnabled: shell.oskEnabled
319 oskEnabled: shell.oskEnabled
314 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
320 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
321+ panelState: panelState
315 }
322 }
316 }
323 }
317
324
@@ -490,6 +497,7 @@ StyledItem {
490 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)
497 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)
491 || greeter.hasLockedApp
498 || greeter.hasLockedApp
492 locked: greeter && greeter.active
499 locked: greeter && greeter.active
500+ panelState: panelState
493 }
501 }
494
502
495 Launcher {
503 Launcher {
qml/Stage/DecoratedWindow.qml+4
@@ -18,6 +18,7 @@ import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
19import Unity.Application 0.1
20import "Spread/MathUtils.js" as MathUtils
20import "Spread/MathUtils.js" as MathUtils
21+import "../Components/PanelState"
21
22
22FocusScope {
23FocusScope {
23 id: root
24 id: root
@@ -70,6 +71,8 @@ FocusScope {
70
71
71 readonly property Item clientAreaItem: applicationWindow
72 readonly property Item clientAreaItem: applicationWindow
72
73
74+ property PanelState panelState
75+
73 signal closeClicked()
76 signal closeClicked()
74 signal maximizeClicked()
77 signal maximizeClicked()
75 signal maximizeHorizontallyClicked()
78 signal maximizeHorizontallyClicked()
@@ -179,6 +182,7 @@ FocusScope {
179 objectName: "moveHandler"
182 objectName: "moveHandler"
180 target: root.parent
183 target: root.parent
181 buttonsWidth: decoration.buttonsWidth
184 buttonsWidth: decoration.buttonsWidth
185+ panelState: root.panelState
182 }
186 }
183
187
184 ApplicationWindow {
188 ApplicationWindow {
qml/Stage/FakeMaximizeDelegate.qml+12−11
@@ -35,6 +35,7 @@ Rectangle {
35 property int leftMargin
35 property int leftMargin
36 property real appContainerWidth
36 property real appContainerWidth
37 property real appContainerHeight
37 property real appContainerHeight
38+ property PanelState panelState
38
39
39 readonly property real hintThreshold: 0.1
40 readonly property real hintThreshold: 0.1
40
41
@@ -178,7 +179,7 @@ Rectangle {
178 ParallelAnimation {
179 ParallelAnimation {
179 id: fakeMaximizeAnimation
180 id: fakeMaximizeAnimation
180 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
181 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
181− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: PanelState.panelHeight }
182+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: panelState.panelHeight }
182 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: appContainerWidth - leftMargin }
183 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: appContainerWidth - leftMargin }
183 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight }
184 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight }
184 }
185 }
@@ -186,39 +187,39 @@ Rectangle {
186 ParallelAnimation {
187 ParallelAnimation {
187 id: fakeMaximizeLeftAnimation
188 id: fakeMaximizeLeftAnimation
188 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
189 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
189− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: PanelState.panelHeight }
190+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: panelState.panelHeight }
190 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
191 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
191− UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight - PanelState.panelHeight }
192+ UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight - panelState.panelHeight }
192 }
193 }
193
194
194 ParallelAnimation {
195 ParallelAnimation {
195 id: fakeMaximizeRightAnimation
196 id: fakeMaximizeRightAnimation
196 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
197 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
197− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: PanelState.panelHeight }
198+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: panelState.panelHeight }
198 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
199 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
199− UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight - PanelState.panelHeight }
200+ UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight - panelState.panelHeight }
200 }
201 }
201
202
202 ParallelAnimation {
203 ParallelAnimation {
203 id: fakeMaximizeTopLeftAnimation
204 id: fakeMaximizeTopLeftAnimation
204 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
205 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
205− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: PanelState.panelHeight }
206+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: panelState.panelHeight }
206 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
207 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
207− UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight - PanelState.panelHeight)/2 }
208+ UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight - panelState.panelHeight)/2 }
208 }
209 }
209
210
210 ParallelAnimation {
211 ParallelAnimation {
211 id: fakeMaximizeTopRightAnimation
212 id: fakeMaximizeTopRightAnimation
212 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
213 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
213− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: PanelState.panelHeight }
214+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: panelState.panelHeight }
214 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
215 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
215− UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight - PanelState.panelHeight)/2 }
216+ UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight - panelState.panelHeight)/2 }
216 }
217 }
217
218
218 ParallelAnimation {
219 ParallelAnimation {
219 id: fakeMaximizeBottomLeftAnimation
220 id: fakeMaximizeBottomLeftAnimation
220 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
221 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: leftMargin }
221− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight + PanelState.panelHeight)/2 }
222+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight + panelState.panelHeight)/2 }
222 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
223 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
223 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight/2 }
224 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight/2 }
224 }
225 }
@@ -226,7 +227,7 @@ Rectangle {
226 ParallelAnimation {
227 ParallelAnimation {
227 id: fakeMaximizeBottomRightAnimation
228 id: fakeMaximizeBottomRightAnimation
228 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
229 UbuntuNumberAnimation { target: fakeRectangle; properties: "x"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth + leftMargin)/2 }
229− UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight + PanelState.panelHeight)/2 }
230+ UbuntuNumberAnimation { target: fakeRectangle; properties: "y"; duration: UbuntuAnimation.BriskDuration; to: (appContainerHeight + panelState.panelHeight)/2 }
230 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
231 UbuntuNumberAnimation { target: fakeRectangle; properties: "width"; duration: UbuntuAnimation.BriskDuration; to: (appContainerWidth - leftMargin)/2 }
231 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight/2 }
232 UbuntuNumberAnimation { target: fakeRectangle; properties: "height"; duration: UbuntuAnimation.BriskDuration; to: appContainerHeight/2 }
232 }
233 }
qml/Stage/MoveHandler.qml+8−7
@@ -28,6 +28,7 @@ QtObject {
28 property int stageWidth
28 property int stageWidth
29 property int stageHeight
29 property int stageHeight
30 property real buttonsWidth: 0
30 property real buttonsWidth: 0
31+ property PanelState panelState
31
32
32 readonly property bool dragging: priv.dragging
33 readonly property bool dragging: priv.dragging
33
34
@@ -122,18 +123,18 @@ QtObject {
122 // position. Mouse movement could have subpixel precision, yielding a fractional
123 // position. Mouse movement could have subpixel precision, yielding a fractional
123 // mouse position.
124 // mouse position.
124 target.windowedX = Math.round(pos.x - priv.distanceX);
125 target.windowedX = Math.round(pos.x - priv.distanceX);
125− target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
126+ target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, panelState.panelHeight));
126
127
127 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay
128 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay
128− if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < PanelState.panelHeight + priv.triggerArea
129+ if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < panelState.panelHeight + priv.triggerArea
129 && target.canBeCornerMaximized) { // top left
130 && target.canBeCornerMaximized) { // top left
130− priv.progress = priv.progressInCorner(0, PanelState.panelHeight, sensingPoints.topLeft.x, sensingPoints.topLeft.y);
131+ priv.progress = priv.progressInCorner(0, panelState.panelHeight, sensingPoints.topLeft.x, sensingPoints.topLeft.y);
131 priv.resetEdges();
132 priv.resetEdges();
132 priv.nearTopLeftCorner = true;
133 priv.nearTopLeftCorner = true;
133 root.fakeMaximizeTopLeftAnimationRequested(priv.progress);
134 root.fakeMaximizeTopLeftAnimationRequested(priv.progress);
134− } else if (sensingPoints.topRight.x > stageWidth - priv.triggerArea && sensingPoints.topRight.y < PanelState.panelHeight + priv.triggerArea
135+ } else if (sensingPoints.topRight.x > stageWidth - priv.triggerArea && sensingPoints.topRight.y < panelState.panelHeight + priv.triggerArea
135 && target.canBeCornerMaximized) { // top right
136 && target.canBeCornerMaximized) { // top right
136− priv.progress = priv.progressInCorner(stageWidth, PanelState.panelHeight, sensingPoints.topRight.x, sensingPoints.topRight.y);
137+ priv.progress = priv.progressInCorner(stageWidth, panelState.panelHeight, sensingPoints.topRight.x, sensingPoints.topRight.y);
137 priv.resetEdges();
138 priv.resetEdges();
138 priv.nearTopRightCorner = true;
139 priv.nearTopRightCorner = true;
139 root.fakeMaximizeTopRightAnimationRequested(priv.progress);
140 root.fakeMaximizeTopRightAnimationRequested(priv.progress);
@@ -159,8 +160,8 @@ QtObject {
159 priv.resetEdges();
160 priv.resetEdges();
160 priv.nearRightEdge = true;
161 priv.nearRightEdge = true;
161 root.fakeMaximizeRightAnimationRequested(priv.progress);
162 root.fakeMaximizeRightAnimationRequested(priv.progress);
162− } else if (sensingPoints.top.y < PanelState.panelHeight + priv.triggerArea && target.canBeMaximized) { // top
163+ } else if (sensingPoints.top.y < panelState.panelHeight + priv.triggerArea && target.canBeMaximized) { // top
163− priv.progress = MathUtils.clampAndProject(sensingPoints.top.y, PanelState.panelHeight + priv.triggerArea, 0, 0, 1);
164+ priv.progress = MathUtils.clampAndProject(sensingPoints.top.y, panelState.panelHeight + priv.triggerArea, 0, 0, 1);
164 priv.resetEdges();
165 priv.resetEdges();
165 priv.nearTopEdge = true;
166 priv.nearTopEdge = true;
166 root.fakeMaximizeAnimationRequested(priv.progress);
167 root.fakeMaximizeAnimationRequested(priv.progress);
qml/Stage/Stage.qml+26−24
@@ -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
49
50
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();
349
350
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(); } }
355 }
356 }
356
357
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
361 }
362 }
362
363
363 Binding {
364 Binding {
364− target: PanelState
365+ target: panelState
365 property: "title"
366 property: "title"
366 value: {
367 value: {
367 if (priv.focusedAppDelegate !== null) {
368 if (priv.focusedAppDelegate !== null) {
@@ -376,21 +377,21 @@ FocusScope {
376 }
377 }
377
378
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"
382 }
383 }
383
384
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
388 }
389 }
389
390
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;
394 }
395 }
395
396
396 Instantiator {
397 Instantiator {
@@ -739,7 +740,7 @@ FocusScope {
739 target: appDelegate
740 target: appDelegate
740 property: "y"
741 property: "y"
741 value: appDelegate.requestedY -
742 value: appDelegate.requestedY -
742− Math.min(appDelegate.requestedY - PanelState.panelHeight,
743+ Math.min(appDelegate.requestedY - panelState.panelHeight,
743 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
744 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
744 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
745 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
745 && root.inputMethodRect.height > 0
746 && root.inputMethodRect.height > 0
@@ -876,7 +877,7 @@ FocusScope {
876 screenWidth: appContainer.width
877 screenWidth: appContainer.width
877 screenHeight: appContainer.height
878 screenHeight: appContainer.height
878 leftMargin: root.leftMargin
879 leftMargin: root.leftMargin
879− minimumY: PanelState.panelHeight
880+ minimumY: panelState.panelHeight
880 }
881 }
881
882
882 Connections {
883 Connections {
@@ -1116,7 +1117,7 @@ FocusScope {
1116 progress: 0
1117 progress: 0
1117 targetHeight: spreadItem.stackHeight
1118 targetHeight: spreadItem.stackHeight
1118 targetX: spreadMaths.targetX
1119 targetX: spreadMaths.targetX
1119− startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1120+ startY: appDelegate.fullscreen ? 0 : panelState.panelHeight
1120 targetY: spreadMaths.targetY
1121 targetY: spreadMaths.targetY
1121 targetAngle: spreadMaths.targetAngle
1122 targetAngle: spreadMaths.targetAngle
1122 targetScale: spreadMaths.targetScale
1123 targetScale: spreadMaths.targetScale
@@ -1235,9 +1236,9 @@ FocusScope {
1235 PropertyChanges {
1236 PropertyChanges {
1236 target: appDelegate
1237 target: appDelegate
1237 x: stageMaths.itemX
1238 x: stageMaths.itemX
1238− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1239+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1239 requestedWidth: appContainer.width
1240 requestedWidth: appContainer.width
1240− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1241+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1241 visuallyMaximized: true
1242 visuallyMaximized: true
1242 visible: appDelegate.x < root.width
1243 visible: appDelegate.x < root.width
1243 }
1244 }
@@ -1263,10 +1264,10 @@ FocusScope {
1263 PropertyChanges {
1264 PropertyChanges {
1264 target: appDelegate
1265 target: appDelegate
1265 x: stageMaths.itemX
1266 x: stageMaths.itemX
1266− y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1267+ y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1267 z: stageMaths.itemZ
1268 z: stageMaths.itemZ
1268 requestedWidth: stageMaths.itemWidth
1269 requestedWidth: stageMaths.itemWidth
1269− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1270+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1270 visuallyMaximized: true
1271 visuallyMaximized: true
1271 visible: appDelegate.x < root.width
1272 visible: appDelegate.x < root.width
1272 }
1273 }
@@ -1331,9 +1332,9 @@ FocusScope {
1331 PropertyChanges {
1332 PropertyChanges {
1332 target: appDelegate
1333 target: appDelegate
1333 windowedX: root.leftMargin
1334 windowedX: root.leftMargin
1334− windowedY: PanelState.panelHeight
1335+ windowedY: panelState.panelHeight
1335 windowedWidth: (appContainer.width - root.leftMargin)/2
1336 windowedWidth: (appContainer.width - root.leftMargin)/2
1336− windowedHeight: appContainer.height - PanelState.panelHeight
1337+ windowedHeight: appContainer.height - panelState.panelHeight
1337 }
1338 }
1338 },
1339 },
1339 State {
1340 State {
@@ -1350,9 +1351,9 @@ FocusScope {
1350 PropertyChanges {
1351 PropertyChanges {
1351 target: appDelegate
1352 target: appDelegate
1352 windowedX: root.leftMargin
1353 windowedX: root.leftMargin
1353− windowedY: PanelState.panelHeight
1354+ windowedY: panelState.panelHeight
1354 windowedWidth: (appContainer.width - root.leftMargin)/2
1355 windowedWidth: (appContainer.width - root.leftMargin)/2
1355− windowedHeight: (appContainer.height - PanelState.panelHeight)/2
1356+ windowedHeight: (appContainer.height - panelState.panelHeight)/2
1356 }
1357 }
1357 },
1358 },
1358 State {
1359 State {
@@ -1369,7 +1370,7 @@ FocusScope {
1369 PropertyChanges {
1370 PropertyChanges {
1370 target: appDelegate
1371 target: appDelegate
1371 windowedX: root.leftMargin
1372 windowedX: root.leftMargin
1372− windowedY: (appContainer.height + PanelState.panelHeight)/2
1373+ windowedY: (appContainer.height + panelState.panelHeight)/2
1373 windowedWidth: (appContainer.width - root.leftMargin)/2
1374 windowedWidth: (appContainer.width - root.leftMargin)/2
1374 windowedHeight: appContainer.height/2
1375 windowedHeight: appContainer.height/2
1375 }
1376 }
@@ -1391,8 +1392,8 @@ FocusScope {
1391 State {
1392 State {
1392 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1393 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1393 extend: "normal"
1394 extend: "normal"
1394− PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: PanelState.panelHeight;
1395+ PropertyChanges { target: appDelegate; windowedX: windowedX; windowedY: panelState.panelHeight;
1395− windowedWidth: windowedWidth; windowedHeight: appContainer.height - PanelState.panelHeight }
1396+ windowedWidth: windowedWidth; windowedHeight: appContainer.height - panelState.panelHeight }
1396 },
1397 },
1397 State {
1398 State {
1398 name: "minimized"; when: appDelegate.minimized
1399 name: "minimized"; when: appDelegate.minimized
@@ -1491,7 +1492,7 @@ FocusScope {
1491 ]
1492 ]
1492
1493
1493 Binding {
1494 Binding {
1494− target: PanelState
1495+ target: panelState
1495 property: "buttonsAlwaysVisible"
1496 property: "buttonsAlwaysVisible"
1496 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1497 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
1497 }
1498 }
@@ -1506,7 +1507,7 @@ FocusScope {
1506 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1507 anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
1507
1508
1508 target: appDelegate
1509 target: appDelegate
1509− minimumY: PanelState.panelHeight // disallow resizing up past Panel
1510+ minimumY: panelState.panelHeight // disallow resizing up past Panel
1510 minWidth: units.gu(10)
1511 minWidth: units.gu(10)
1511 minHeight: units.gu(10)
1512 minHeight: units.gu(10)
1512 borderThickness: units.gu(2)
1513 borderThickness: units.gu(2)
@@ -1699,6 +1700,7 @@ FocusScope {
1699 leftMargin: root.leftMargin
1700 leftMargin: root.leftMargin
1700 appContainerWidth: appContainer.width
1701 appContainerWidth: appContainer.width
1701 appContainerHeight: appContainer.height
1702 appContainerHeight: appContainer.height
1703+ panelState: root.panelState
1702 }
1704 }
1703
1705
1704 EdgeBarrier {
1706 EdgeBarrier {
qml/Stage/WindowControlsOverlay.qml+2
@@ -27,6 +27,7 @@ Item {
27
27
28 // to be set from outside
28 // to be set from outside
29 property Item target // appDelegate
29 property Item target // appDelegate
30+ property PanelState panelState
30 property alias stageWidth: moveHandler.stageWidth
31 property alias stageWidth: moveHandler.stageWidth
31 property alias stageHeight: moveHandler.stageHeight
32 property alias stageHeight: moveHandler.stageHeight
32
33
@@ -161,6 +162,7 @@ Item {
161 id: moveHandler
162 id: moveHandler
162 objectName: "moveHandler"
163 objectName: "moveHandler"
163 target: root.target
164 target: root.target
165+ panelState: root.panelState
164
166
165 onFakeMaximizeAnimationRequested: root.fakeMaximizeAnimationRequested(amount)
167 onFakeMaximizeAnimationRequested: root.fakeMaximizeAnimationRequested(amount)
166 onFakeMaximizeLeftAnimationRequested: root.fakeMaximizeLeftAnimationRequested(amount)
168 onFakeMaximizeLeftAnimationRequested: root.fakeMaximizeLeftAnimationRequested(amount)
tests/qmltests/Panel/tst_Panel.qml+9−8
@@ -23,7 +23,6 @@ import Unity.Application 0.1
23import Unity.Indicators 0.1 as Indicators
23import Unity.Indicators 0.1 as Indicators
24import Ubuntu.Telephony 0.1 as Telephony
24import Ubuntu.Telephony 0.1 as Telephony
25import "../../../qml/Panel"
25import "../../../qml/Panel"
26−import "../../../qml/Components/PanelState"
27
26
28IndicatorTest {
27IndicatorTest {
29 id: root
28 id: root
@@ -33,6 +32,8 @@ IndicatorTest {
33
32
34 Component.onCompleted: theme.name = "Ubuntu.Components.Themes.SuruDark"
33 Component.onCompleted: theme.name = "Ubuntu.Components.Themes.SuruDark"
35
34
35+ readonly property alias panelState: panel.panelState
36+
36 SurfaceManager {}
37 SurfaceManager {}
37
38
38 Binding {
39 Binding {
@@ -109,7 +110,7 @@ IndicatorTest {
109 Layout.fillWidth: true
110 Layout.fillWidth: true
110 CheckBox {
111 CheckBox {
111 id: windowControlsCB
112 id: windowControlsCB
112− onClicked: PanelState.buttonsVisible = checked
113+ onClicked: panelState.buttonsVisible = checked
113 }
114 }
114 Label {
115 Label {
115 text: "Show window controls"
116 text: "Show window controls"
@@ -121,9 +122,9 @@ IndicatorTest {
121 CheckBox {
122 CheckBox {
122 onClicked: {
123 onClicked: {
123 if (checked)
124 if (checked)
124− PanelState.title = "Fake window title"
125+ panelState.title = "Fake window title"
125 else
126 else
126− PanelState.title = ""
127+ panelState.title = ""
127 }
128 }
128 }
129 }
129 Label {
130 Label {
@@ -186,7 +187,7 @@ IndicatorTest {
186
187
187 SignalSpy {
188 SignalSpy {
188 id: windowControlButtonsSpy
189 id: windowControlButtonsSpy
189− target: PanelState
190+ target: panelState
190 signalName: "closeClicked"
191 signalName: "closeClicked"
191 }
192 }
192
193
@@ -510,13 +511,13 @@ IndicatorTest {
510
511
511 // https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1611959
512 // https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1611959
512 function test_windowControlButtonsFittsLaw() {
513 function test_windowControlButtonsFittsLaw() {
513− var buttonsVisible = PanelState.buttonsVisible;
514+ var buttonsVisible = panelState.buttonsVisible;
514− PanelState.buttonsVisible = true;
515+ panelState.buttonsVisible = true;
515 // click in very topleft corner and verify the close button got clicked too
516 // click in very topleft corner and verify the close button got clicked too
516 mouseMove(panel, 0, 0);
517 mouseMove(panel, 0, 0);
517 mouseClick(panel, 0, 0, undefined /*button*/, undefined /*modifiers*/, 100 /*short delay*/);
518 mouseClick(panel, 0, 0, undefined /*button*/, undefined /*modifiers*/, 100 /*short delay*/);
518 compare(windowControlButtonsSpy.count, 1);
519 compare(windowControlButtonsSpy.count, 1);
519− PanelState.buttonsVisible = buttonsVisible;
520+ panelState.buttonsVisible = buttonsVisible;
520 }
521 }
521 }
522 }
522}
523}
tests/qmltests/Stage/tst_DesktopStage.qml+8−3
@@ -41,6 +41,10 @@ Item {
41 value: false
41 value: false
42 }
42 }
43
43
44+ PanelState {
45+ id: panelState
46+ }
47+
44 Component.onCompleted: {
48 Component.onCompleted: {
45 theme.name = "Ubuntu.Components.Themes.SuruDark";
49 theme.name = "Ubuntu.Components.Themes.SuruDark";
46 resetGeometry();
50 resetGeometry();
@@ -92,6 +96,7 @@ Item {
92 topLevelSurfaceList: topSurfaceList
96 topLevelSurfaceList: topSurfaceList
93 interactive: true
97 interactive: true
94 mode: "windowed"
98 mode: "windowed"
99+ panelState: panelState
95 }
100 }
96 }
101 }
97
102
@@ -624,19 +629,19 @@ Item {
624 maximizeDelegate(facebookAppDelegate);
629 maximizeDelegate(facebookAppDelegate);
625
630
626 // verify the drop shadow is still not visible
631 // verify the drop shadow is still not visible
627− verify(PanelState.dropShadow == false);
632+ verify(panelState.dropShadow == false);
628
633
629 // start a foreground app, not maximized
634 // start a foreground app, not maximized
630 var dialerAppDelegate = startApplication("dialer-app");
635 var dialerAppDelegate = startApplication("dialer-app");
631
636
632 // verify the drop shadow becomes visible
637 // verify the drop shadow becomes visible
633− verify(PanelState.dropShadow == true);
638+ verify(panelState.dropShadow == true);
634
639
635 // close the maximized app
640 // close the maximized app
636 ApplicationManager.stopApplication("facebook-webapp");
641 ApplicationManager.stopApplication("facebook-webapp");
637
642
638 // verify the drop shadow is gone
643 // verify the drop shadow is gone
639− tryCompare(PanelState, "dropShadow", false);
644+ tryCompare(panelState, "dropShadow", false);
640 }
645 }
641
646
642 function test_threeFingerTapShowsWindowControls_data() {
647 function test_threeFingerTapShowsWindowControls_data() {
tests/qmltests/Stage/tst_WindowResizeArea.qml+1−8
@@ -19,7 +19,6 @@ import QtQuick.Layouts 1.1
19import QtTest 1.0
19import QtTest 1.0
20import Unity.Test 0.1
20import Unity.Test 0.1
21import ".."
21import ".."
22−import "../../../qml/Components/PanelState"
23import "../../../qml/Stage"
22import "../../../qml/Stage"
24import Ubuntu.Components 1.3
23import Ubuntu.Components 1.3
25import Ubuntu.Components.ListItems 1.3 as ListItem
24import Ubuntu.Components.ListItems 1.3 as ListItem
@@ -31,12 +30,6 @@ Item {
31 height: units.gu(60)
30 height: units.gu(60)
32 width: units.gu(85)
31 width: units.gu(85)
33
32
34− Binding {
35− target: PanelState
36− property: "panelHeight"
37− value: units.gu(3)
38− }
39−
40 Component {
33 Component {
41 id: fakeWindowComponent
34 id: fakeWindowComponent
42
35
@@ -352,7 +345,7 @@ Item {
352
345
353 // Make sure it's again where we left it in normal state before destroying
346 // Make sure it's again where we left it in normal state before destroying
354 compare(fakeWindow.requestedX >= 0, true)
347 compare(fakeWindow.requestedX >= 0, true)
355− compare(fakeWindow.requestedY >= PanelState.panelHeight, true)
348+ compare(fakeWindow.requestedY >= 0, true)
356 compare(fakeWindow.requestedX + fakeWindow.width <= root.width, true)
349 compare(fakeWindow.requestedX + fakeWindow.width <= root.width, true)
357 compare(fakeWindow.requestedY + fakeWindow.height <= root.height, true)
350 compare(fakeWindow.requestedY + fakeWindow.height <= root.height, true)
358
351
tests/qmltests/tst_OrientedShell.qml+13−5
@@ -29,7 +29,6 @@ import Utils 0.1
29
29
30import "../../qml"
30import "../../qml"
31import "../../qml/Components"
31import "../../qml/Components"
32−import "../../qml/Components/PanelState"
33import "Stage"
32import "Stage"
34
33
35Rectangle {
34Rectangle {
@@ -439,6 +438,15 @@ Rectangle {
439 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
438 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
440 property Item shell
439 property Item shell
441 property QtObject topLevelSurfaceList
440 property QtObject topLevelSurfaceList
441+ property var panelState: undefined
442+
443+ onOrientedShellChanged: {
444+ if (orientedShell) {
445+ panelState = findInvisibleChild(shell, "panelState");
446+ } else {
447+ panelState = undefined;
448+ }
449+ }
442
450
443 SignalSpy { id: signalSpy }
451 SignalSpy { id: signalSpy }
444 SignalSpy { id: signalSpy2 }
452 SignalSpy { id: signalSpy2 }
@@ -1507,13 +1515,13 @@ Rectangle {
1507 print("exptectedAngle", expectedAngle, point.x, point.y)
1515 print("exptectedAngle", expectedAngle, point.x, point.y)
1508 switch (expectedAngle) {
1516 switch (expectedAngle) {
1509 case 0:
1517 case 0:
1510− return point.x === 0 && point.y === PanelState.panelHeight;
1518+ return point.x === 0 && point.y === panelState.panelHeight;
1511 case 90:
1519 case 90:
1512− return point.x === orientedShell.width - PanelState.panelHeight && point.y === 0;
1520+ return point.x === orientedShell.width - panelState.panelHeight && point.y === 0;
1513 case 180:
1521 case 180:
1514− return point.x === orientedShell.width && point.y === orientedShell.height - PanelState.panelHeight;
1522+ return point.x === orientedShell.width && point.y === orientedShell.height - panelState.panelHeight;
1515 default: // 270
1523 default: // 270
1516− return point.x === PanelState.panelHeight && point.y === orientedShell.height;
1524+ return point.x === panelState.panelHeight && point.y === orientedShell.height;
1517 }
1525 }
1518 }
1526 }
1519
1527
tests/qmltests/tst_Shell.qml+13−10
@@ -55,12 +55,15 @@ Rectangle {
55 onShellChanged: {
55 onShellChanged: {
56 if (shell) {
56 if (shell) {
57 topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
57 topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
58+ panelState = testCase.findInvisibleChild(shell, "panelState");
58 } else {
59 } else {
59 topLevelSurfaceList = null;
60 topLevelSurfaceList = null;
61+ panelState = undefined;
60 }
62 }
61 }
63 }
62
64
63 property var topLevelSurfaceList: null
65 property var topLevelSurfaceList: null
66+ property var panelState: undefined
64
67
65 Item {
68 Item {
66 id: shellContainer
69 id: shellContainer
@@ -1878,21 +1881,21 @@ Rectangle {
1878 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1881 var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1879
1882
1880 tryCompare(appDelegate, "state", "normal");
1883 tryCompare(appDelegate, "state", "normal");
1881− tryCompare(PanelState, "buttonsVisible", false)
1884+ tryCompare(panelState, "buttonsVisible", false)
1882
1885
1883 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1886 mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1884 tryCompare(appDelegate, "state", "maximized");
1887 tryCompare(appDelegate, "state", "maximized");
1885− tryCompare(PanelState, "buttonsVisible", true)
1888+ tryCompare(panelState, "buttonsVisible", true)
1886
1889
1887 ApplicationManager.stopApplication(application.appId);
1890 ApplicationManager.stopApplication(application.appId);
1888− tryCompare(PanelState, "buttonsVisible", false)
1891+ tryCompare(panelState, "buttonsVisible", false)
1889
1892
1890 // wait until all zombie surfaces are gone. As MirSurfaceItems hold references over them.
1893 // wait until all zombie surfaces are gone. As MirSurfaceItems hold references over them.
1891 // They won't be gone until those surface items are destroyed.
1894 // They won't be gone until those surface items are destroyed.
1892 tryCompareFunction(function() { return application.surfaceList.count }, 0);
1895 tryCompareFunction(function() { return application.surfaceList.count }, 0);
1893
1896
1894 ApplicationManager.startApplication(application.appId);
1897 ApplicationManager.startApplication(application.appId);
1895− tryCompare(PanelState, "buttonsVisible", true)
1898+ tryCompare(panelState, "buttonsVisible", true)
1896 }
1899 }
1897
1900
1898 function test_newAppHasValidGeometry() {
1901 function test_newAppHasValidGeometry() {
@@ -1948,7 +1951,7 @@ Rectangle {
1948 mousePress(appDelegate, appDelegate.width / 2, units.gu(1))
1951 mousePress(appDelegate, appDelegate.width / 2, units.gu(1))
1949 mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100))
1952 mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100))
1950
1953
1951− compare(appDelegate.y >= PanelState.panelHeight, true);
1954+ compare(appDelegate.y >= panelState.panelHeight, true);
1952 }
1955 }
1953
1956
1954 function test_cantResizeWindowUnderPanel() {
1957 function test_cantResizeWindowUnderPanel() {
@@ -1976,7 +1979,7 @@ Rectangle {
1976 mouseMove(decoration, decoration.width/2, -units.gu(100));
1979 mouseMove(decoration, decoration.width/2, -units.gu(100));
1977
1980
1978 // verify we don't go past the panel
1981 // verify we don't go past the panel
1979− compare(appDelegate.y >= PanelState.panelHeight, true);
1982+ compare(appDelegate.y >= panelState.panelHeight, true);
1980 }
1983 }
1981
1984
1982 function test_restoreWindowStateFixesIfUnderPanel() {
1985 function test_restoreWindowStateFixesIfUnderPanel() {
@@ -2000,7 +2003,7 @@ Rectangle {
2000 tryCompareFunction(function () { return topLevelSurfaceList.applicationAt(0).appId; }, application.appId);
2003 tryCompareFunction(function () { return topLevelSurfaceList.applicationAt(0).appId; }, application.appId);
2001
2004
2002 appDelegate = appRepeater.itemAt(0);
2005 appDelegate = appRepeater.itemAt(0);
2003− compare(appDelegate.y >= PanelState.panelHeight, true);
2006+ compare(appDelegate.y >= panelState.panelHeight, true);
2004 }
2007 }
2005
2008
2006 function test_lifecyclePolicyForNonTouchApp_data() {
2009 function test_lifecyclePolicyForNonTouchApp_data() {
@@ -2601,7 +2604,7 @@ Rectangle {
2601 function test_oskDisplacesWindow_data() {
2604 function test_oskDisplacesWindow_data() {
2602 return [
2605 return [
2603 {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2606 {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2604− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight, oskEnabled: true},
2607+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: panelState.panelHeight, oskEnabled: true},
2605 {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2608 {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2606 ]
2609 ]
2607 }
2610 }
@@ -2624,8 +2627,8 @@ Rectangle {
2624 dashAppDelegate.windowedY = data.windowY;
2627 dashAppDelegate.windowedY = data.windowY;
2625 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2628 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2626 var initialY = dashAppDelegate.y;
2629 var initialY = dashAppDelegate.y;
2627− print("intial", initialY, "panel", PanelState.panelHeight);
2630+ print("intial", initialY, "panel", panelState.panelHeight);
2628− verify(initialY > PanelState.panelHeight);
2631+ verify(initialY > panelState.panelHeight);
2629
2632
2630 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2633 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2631 tryCompare(dashAppDelegate, "y", data.targetDisplacement);
2634 tryCompare(dashAppDelegate, "y", data.targetDisplacement);