on xenial help sign in
Use ApplicationManager as the model instead of SurfaceManager in the stage
56e7311Daniel d'Andrada
qml/Shell.qml+2−2
@@ -232,8 +232,8 @@ FocusScope {
232
232
233 Binding {
233 Binding {
234 target: applicationsDisplayLoader.item
234 target: applicationsDisplayLoader.item
235− property: "surfaces"
235+ property: "applications"
236− value: SurfaceManager
236+ value: ApplicationManager
237 }
237 }
238 Binding {
238 Binding {
239 target: applicationsDisplayLoader.item
239 target: applicationsDisplayLoader.item
qml/Stages/PhoneStage.qml+3−10
@@ -28,9 +28,7 @@ Rectangle {
28 // Controls to be set from outside
28 // Controls to be set from outside
29 property int dragAreaWidth
29 property int dragAreaWidth
30 property real maximizedAppTopMargin
30 property real maximizedAppTopMargin
31−
32− // FIXME: Should be registerd singleton type QAbstractItemModel.
33− property var surfaces
31+ property var applications
34
32
35 // State information propagated to the outside
33 // State information propagated to the outside
36 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
34 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
@@ -95,8 +93,6 @@ Rectangle {
95 applicationSwitchingAnimation.start();
93 applicationSwitchingAnimation.start();
96 } else {
94 } else {
97 ApplicationManager.focusApplication(appId);
95 ApplicationManager.focusApplication(appId);
98− // TODO: Should happen behind the schenes
99− surfaces.move(surfaces.getIndexOfSurfaceWithAppId(appId), 0);
100 }
96 }
101 }
97 }
102
98
@@ -213,9 +209,6 @@ Rectangle {
213 if (spreadView.selectedIndex >= 0) {
209 if (spreadView.selectedIndex >= 0) {
214 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
210 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
215
211
216− // TODO: Should happen behind the schenes
217− surfaces.move(spreadView.selectedIndex, 0);
218−
219 spreadView.selectedIndex = -1
212 spreadView.selectedIndex = -1
220 spreadView.phase = 0;
213 spreadView.phase = 0;
221 spreadView.contentX = -spreadView.shift;
214 spreadView.contentX = -spreadView.shift;
@@ -235,7 +228,7 @@ Rectangle {
235
228
236 Repeater {
229 Repeater {
237 id: spreadRepeater
230 id: spreadRepeater
238− model: root.surfaces
231+ model: root.applications
239 delegate: TransformedSpreadDelegate {
232 delegate: TransformedSpreadDelegate {
240 id: appDelegate
233 id: appDelegate
241 objectName: "appDelegate" + index
234 objectName: "appDelegate" + index
@@ -249,7 +242,7 @@ Rectangle {
249 height: spreadView.height
242 height: spreadView.height
250 selected: spreadView.selectedIndex == index
243 selected: spreadView.selectedIndex == index
251 otherSelected: spreadView.selectedIndex >= 0 && !selected
244 otherSelected: spreadView.selectedIndex >= 0 && !selected
252− surface: model.surface
245+ application: root.applications.get(index)
253 interactive: !spreadView.interactive
246 interactive: !spreadView.interactive
254 maximizedAppTopMargin: root.maximizedAppTopMargin
247 maximizedAppTopMargin: root.maximizedAppTopMargin
255
248
qml/Stages/SpreadDelegate.qml+2−1
@@ -26,10 +26,11 @@ 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
29
30
30 // FIXME: This really should be invisible to QML code.
31 // FIXME: This really should be invisible to QML code.
31 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
32 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
32− property var surface
33+ property var surface: application ? application.surface : null
33 onSurfaceChanged: {
34 onSurfaceChanged: {
34 if (surface) {
35 if (surface) {
35 surface.parent = root;
36 surface.parent = root;