@@ -1,5 +1,5 @@
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013, 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@ Item {
36 signal contentEndReached()
36 signal contentEndReached()
37 signal scopeLoaded(string scopeId)
37 signal scopeLoaded(string scopeId)
38 signal positionedAtBeginning()
38 signal positionedAtBeginning()
39+ signal gotoScope(string scopeId)
40+ signal openScope(var scope)
40 // If we set the current scope index before the scopes have been added,
42 // If we set the current scope index before the scopes have been added,
41 // then we need to wait until the loaded signals gets emitted from the scopes
43 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -80,6 +82,10 @@ Item {
85+ function closeScope(scope) {
86+ dashContentList.currentItem.theScope.closeScope(scope)
84 id: dashContentListHolder
90 id: dashContentListHolder
85 anchors.fill: parent
91 anchors.fill: parent
@@ -136,8 +142,8 @@ Item {
136 onLoaded: {
142 onLoaded: {
137 item.scope = Qt.binding(function() { return scope })
143 item.scope = Qt.binding(function() { return scope })
138 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
144 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
139− item.tabBarHeight = pageHeader.implicitHeight;
145+ item.tabBarHeight = dashPageHeader.implicitHeight;
140− item.pageHeader = pageHeader;
146+ item.pageHeader = dashPageHeader;
141 item.openEffect = openEffect;
147 item.openEffect = openEffect;
142 item.previewListView = previewListView;
148 item.previewListView = previewListView;
143 dashContentList.movementStarted.connect(item.movementStarted)
149 dashContentList.movementStarted.connect(item.movementStarted)
@@ -149,13 +155,23 @@ Item {
149 ignoreUnknownSignals: true
155 ignoreUnknownSignals: true
150 onEndReached: contentEndReached()
156 onEndReached: contentEndReached()
159+ target: isCurrent ? scope : null
161+ // Note here scopeId is the signal parameter and not the loader property
162+ dashContent.gotoScope(scopeId);
165+ dashContent.openScope(scope);
153 Component.onDestruction: active = false
169 Component.onDestruction: active = false
157 PageHeader {
173 PageHeader {
158− id: pageHeader
174+ id: dashPageHeader
159 objectName: "pageHeader"
175 objectName: "pageHeader"
160 width: parent.width
176 width: parent.width
161 searchEntryEnabled: true
177 searchEntryEnabled: true
@@ -218,6 +234,7 @@ Item {
218 openEffect: openEffect
234 openEffect: openEffect
219 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null
235 categoryView: dashContentList.currentItem ? dashContentList.currentItem.categoryView : null
220 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
236 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
237+ pageHeader: dashPageHeader
221 anchors.fill: parent
238 anchors.fill: parent