@@ -26,14 +26,21 @@ Item {
26 property real topMarginProgress
26 property real topMarginProgress
27 property bool interactive: true
27 property bool interactive: true
28 property real maximizedAppTopMargin
28 property real maximizedAppTopMargin
29− property var application: ApplicationManager.get(index)
31 // FIXME: This really should be invisible to QML code.
30 // FIXME: This really should be invisible to QML code.
32 // 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.
33− property var surface: application ? application.surface : null
32+ readonly property var surface: model.surface
34− onSurfaceChanged: {
33+ onSurfaceChanged: { print("SURFACE!!", model.surface)
35− if (surface && !priv.appHasCreatedASurface) {
35+ if (!priv.appHasCreatedASurface) {
36+ surface.visible = false; // hide until splash screen removed
36− priv.appHasCreatedASurface = true;
37+ priv.appHasCreatedASurface = true;
40+ surface.parent = root;
41+ surface.anchors.fill = root;
42+ priv.checkFullscreen(surface);
@@ -69,7 +76,7 @@ Item {
70 Connections {
77 Connections {
71 target: surface
78 target: surface
72− onStateChanged: priv.checkFullScreen(surface);
79+ onStateChanged: priv.checkFullscreen(surface);
75 StateGroup {
82 StateGroup {
@@ -79,14 +86,13 @@ Item {
79 name: "noSurfaceYet"
86 name: "noSurfaceYet"
80 when: !priv.appHasCreatedASurface
87 when: !priv.appHasCreatedASurface
81 StateChangeScript {
88 StateChangeScript {
82− script: {splashLoader.setSource("Splash.qml", { "name": application.name, "image": application.icon }); print("SPLASH!!")}
89+ script: {splashLoader.setSource("Splash.qml", { "name": model.name, "image": model.icon }); }
86 name: "hasSurface"
93 name: "hasSurface"
87 when: priv.appHasCreatedASurface && (root.surface !== null)
94 when: priv.appHasCreatedASurface && (root.surface !== null)
88− PropertyChanges { target: root.surface; parent: root; anchors.fill: parent; z: 1; visible: false }
89− StateChangeScript { script: { priv.checkFullscreen(root.surface); surfaceRevealDelay.start(); } }
95+ StateChangeScript { script: { surfaceRevealDelay.start(); } }
92 name: "surfaceLostButAppStillAlive"
98 name: "surfaceLostButAppStillAlive"
@@ -105,7 +111,7 @@ Item {
106 BorderImage {
112 BorderImage {
107 id: dropShadow
113 id: dropShadow
108− anchors.fill: surface
114+ anchors.fill: parent
109 anchors.margins: -units.gu(2)
115 anchors.margins: -units.gu(2)
110 source: "graphics/dropshadow.png"
116 source: "graphics/dropshadow.png"
111 opacity: .4
117 opacity: .4
@@ -122,7 +128,4 @@ Item {
122 root.clicked()
128 root.clicked()
126− Component.onCompleted: print("SpreadDelegate created", root, application)
127− Component.onDestruction: print("SpreadDelegate destroyed", root, application)