@@ -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
32− // FIXME: Should be registerd singleton type QAbstractItemModel.
33− property var surfaces
31+ property var applications
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();
97 ApplicationManager.focusApplication(appId);
95 ApplicationManager.focusApplication(appId);
98− // TODO: Should happen behind the schenes
99− surfaces.move(surfaces.getIndexOfSurfaceWithAppId(appId), 0);
@@ -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);
216− // TODO: Should happen behind the schenes
217− surfaces.move(spreadView.selectedIndex, 0);
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 {
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