on xenial help sign in
use surface anchors rather than internal item
d2cb49dNick Dedekind
qml/Stages/SpreadDelegate.qml+2−3
@@ -30,7 +30,7 @@ Item {
30 property real maximizedAppTopMargin
30 property real maximizedAppTopMargin
31 property alias swipeToCloseEnabled: dragArea.enabled
31 property alias swipeToCloseEnabled: dragArea.enabled
32
32
33− readonly property bool isFullscreen: surface !== null && surfaceContainer.surfaceArea.anchors.topMargin == 0
33+ readonly property bool isFullscreen: surface !== null && surfaceContainer.surface.anchors.topMargin == 0
34
34
35 signal clicked()
35 signal clicked()
36 signal closed()
36 signal closed()
@@ -56,10 +56,9 @@ Item {
56 }
56 }
57
57
58 Binding {
58 Binding {
59− target: surfaceContainer.surfaceArea
59+ target: surfaceContainer.surface
60 property: "anchors.topMargin"
60 property: "anchors.topMargin"
61 value: {
61 value: {
62− if (!surfaceContainer.surface) return 0;
63 return surfaceContainer.surface.state === MirSurfaceItem.Fullscreen ? 0 : maximizedAppTopMargin;
62 return surfaceContainer.surface.state === MirSurfaceItem.Fullscreen ? 0 : maximizedAppTopMargin;
64 }
63 }
65 }
64 }
qml/Stages/SurfaceContainer.qml+9−10
@@ -20,7 +20,6 @@ import "Animations"
20Item {
20Item {
21 id: container
21 id: container
22 property Item surface: null
22 property Item surface: null
23− readonly property alias surfaceArea: _surfaceArea
24 property bool removing: false
23 property bool removing: false
25
24
26 onSurfaceChanged: {
25 onSurfaceChanged: {
@@ -31,12 +30,6 @@ Item {
31 }
30 }
32 }
31 }
33
32
34− Rectangle {
35− id: _surfaceArea
36− anchors.fill: parent
37− color: Qt.rgba(0,0,0,0)
38− }
39−
40 Connections {
33 Connections {
41 target: surface
34 target: surface
42 onRemoved: {
35 onRemoved: {
@@ -63,7 +56,13 @@ Item {
63
56
64 delegate: Loader {
57 delegate: Loader {
65 z: 2
58 z: 2
66− anchors.fill: surfaceArea
59+ anchors {
60+ fill: container
61+ topMargin: container.surface.anchors.topMargin
62+ rightMargin: container.surface.anchors.rightMargin
63+ bottomMargin: container.surface.anchors.bottomMargin
64+ leftMargin: container.surface.anchors.leftMargin
65+ }
67
66
68 // Only way to do recursive qml items.
67 // Only way to do recursive qml items.
69 source: Qt.resolvedUrl("SurfaceContainer.qml")
68 source: Qt.resolvedUrl("SurfaceContainer.qml")
@@ -76,7 +75,7 @@ Item {
76 }
75 }
77
76
78 function animateIn(component) {
77 function animateIn(component) {
79− var animation = component.createObject(container, { "surface": container.surface, "surfaceArea": container.surfaceArea });
78+ var animation = component.createObject(container, { "surface": container.surface, "surfaceArea": container });
80 animation.start();
79 animation.start();
81
80
82 var tmp = d.animations;
81 var tmp = d.animations;
@@ -117,7 +116,7 @@ Item {
117 states: [
116 states: [
118 State {
117 State {
119 name: "initial"
118 name: "initial"
120− PropertyChanges { target: surface; anchors.fill: surfaceArea }
119+ PropertyChanges { target: surface; anchors.fill: container }
121 }
120 }
122 // TODO: more animations!
121 // TODO: more animations!
123 ]
122 ]