on xenial help sign in
AppMan supplies proper model now, use it. Splash screen works better now
commit7ab33aaaa331af5ca79a9036f08cb3c7077fc05b authorGerry Boland <gerry.boland@canonical.com> dateFri 6 Jun 2014, 02:11 (12 years ago) parentce8caa4
1 file changed+16−13
qml/Stages/SpreadDelegate.qml+16−13
qml/Stages/SpreadDelegate.qml+16−13
@@ -26,14 +26,21 @@ Item {
2626 property real topMarginProgress
2727 property bool interactive: true
2828 property real maximizedAppTopMargin
29− property var application: ApplicationManager.get(index)
3029
3130 // FIXME: This really should be invisible to QML code.
3231 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
33− property var surface: application ? application.surface : null
34− onSurfaceChanged: {
35− if (surface && !priv.appHasCreatedASurface) {
36− priv.appHasCreatedASurface = true;
32+ readonly property var surface: model.surface
33+ onSurfaceChanged: { print("SURFACE!!", model.surface)
34+ if (surface) {
35+ if (!priv.appHasCreatedASurface) {
36+ surface.visible = false; // hide until splash screen removed
37+ priv.appHasCreatedASurface = true;
38+ }
39+
40+ surface.parent = root;
41+ surface.anchors.fill = root;
42+ priv.checkFullscreen(surface);
43+ surface.z = 1;
3744 }
3845 }
3946
@@ -69,7 +76,7 @@ Item {
6976
7077 Connections {
7178 target: surface
72− onStateChanged: priv.checkFullScreen(surface);
79+ onStateChanged: priv.checkFullscreen(surface);
7380 }
7481
7582 StateGroup {
@@ -79,14 +86,13 @@ Item {
7986 name: "noSurfaceYet"
8087 when: !priv.appHasCreatedASurface
8188 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 }); }
8390 }
8491 },
8592 State {
8693 name: "hasSurface"
8794 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(); } }
9096 },
9197 State {
9298 name: "surfaceLostButAppStillAlive"
@@ -105,7 +111,7 @@ Item {
105111
106112 BorderImage {
107113 id: dropShadow
108− anchors.fill: surface
114+ anchors.fill: parent
109115 anchors.margins: -units.gu(2)
110116 source: "graphics/dropshadow.png"
111117 opacity: .4
@@ -122,7 +128,4 @@ Item {
122128 root.clicked()
123129 }
124130 }
125−
126− Component.onCompleted: print("SpreadDelegate created", root, application)
127− Component.onDestruction: print("SpreadDelegate destroyed", root, application)
128131}