on xenial help sign in
AppMan supplies proper model now, use it. Splash screen works better now
7ab33aaGerry Boland
qml/Stages/SpreadDelegate.qml+16−13
@@ -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)
30
29
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)
34+ if (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;
38+ }
39+
40+ surface.parent = root;
41+ surface.anchors.fill = root;
42+ priv.checkFullscreen(surface);
43+ surface.z = 1;
37 }
44 }
38 }
45 }
39
46
@@ -69,7 +76,7 @@ Item {
69
76
70 Connections {
77 Connections {
71 target: surface
78 target: surface
72− onStateChanged: priv.checkFullScreen(surface);
79+ onStateChanged: priv.checkFullscreen(surface);
73 }
80 }
74
81
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 }); }
83 }
90 }
84 },
91 },
85 State {
92 State {
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(); } }
90 },
96 },
91 State {
97 State {
92 name: "surfaceLostButAppStillAlive"
98 name: "surfaceLostButAppStillAlive"
@@ -105,7 +111,7 @@ Item {
105
111
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()
123 }
129 }
124 }
130 }
125−
126− Component.onCompleted: print("SpreadDelegate created", root, application)
127− Component.onDestruction: print("SpreadDelegate destroyed", root, application)
128}
131}