@@ -17,6 +17,7 @@
19import QtQuick 2.0
19import QtQuick 2.0
20+import Mir.Application 0.1
@@ -24,7 +25,7 @@ Item {
24 signal clicked()
25 signal clicked()
25 property real topMarginProgress
26 property real topMarginProgress
26 property bool interactive: true
27 property bool interactive: true
27− property int orientationAngle
28+ property real maximizedAppTopMargin
29 // FIXME: This really should be invisible to QML code.
30 // FIXME: This really should be invisible to QML code.
30 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
31 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
@@ -34,22 +35,25 @@ Item {
34 surface.parent = root;
35 surface.parent = root;
35 surface.enabled = root.interactive;
36 surface.enabled = root.interactive;
36 surface.z = 1;
37 surface.z = 1;
38− // for the counter-rotation
39− surface.transformOrigin = Item.TopLeft;
43− // Applications already rotate automatically. And so does the shell
41+ state: {
44− // Therefore we have to counter-rotate the app item to undo the rotation applied to
42+ if (surface) {
45− // it by the shell
43+ if (surface.state === MirSurfaceItem.Fullscreen) {
46− state: orientationAngle.toString()
44+ "fullscreen";
49− name: "0"
54+ name: "fullscreen"
50 PropertyChanges {
55 PropertyChanges {
51 target: surface
56 target: surface
55 width: root.width
59 width: root.width
@@ -57,37 +61,17 @@ Item {
60− name: "90"
64+ name: "maximized"
61 PropertyChanges {
65 PropertyChanges {
62 target: surface
66 target: surface
65− y: root.height
68+ y: maximizedAppTopMargin
77 width: root.width
69 width: root.width
78− height: root.height
70+ height: root.height - y
82− name: "270"
74+ name: "empty"
@@ -99,7 +83,7 @@ Item {
100 BorderImage {
84 BorderImage {
101 id: dropShadow
85 id: dropShadow
102− anchors.fill: root
86+ anchors.fill: surface
103 anchors.margins: -units.gu(2)
87 anchors.margins: -units.gu(2)
104 source: "graphics/dropshadow.png"
88 source: "graphics/dropshadow.png"
105 opacity: .4
89 opacity: .4