on xenial help sign in
bind current item
commit6fe575f9d3fa3ada2d1f2ed4253edf2076ec2220 authorAlbert Astals <albert.astals@canonical.com> dateMon 14 Jul 2014, 09:45 (12 years ago) parent7466657
2 files changed+10−1
qml/Dash/Dash.qml+1 qml/Dash/ScopesOverview.qml+9−1
qml/Dash/Dash.qml+1
@@ -93,6 +93,7 @@ Showable {
9393 progress: overviewController.progress
9494 scopeScale: 1 - overviewController.progress * 0.6
9595 visible: scopeScale != 1
96+ currentIndex: dashContent.currentIndex
9697 onDone: hide();
9798 onFavoriteSelected: {
9899 dashContent.setCurrentScopeAtIndex(index, false, false);
qml/Dash/ScopesOverview.qml+9−1
@@ -26,7 +26,14 @@ Item {
2626 // TODO This needs to account for when all is the current item
2727 // And All needs a currentItem concept
2828 // TODO we also need a centered item so when we click done from all the item grows from the middle: think
29− property var dashItemEater: middleItems.count > 1 ? middleItems.itemAt(0).item.currentItem.item : null
29+ property var dashItemEater: {
30+ if (middleItems.count > tabBarHolder.currentTab) {
31+ var loader = middleItems.itemAt(tabBarHolder.currentTab).item;
32+ return loader && loader.currentItem ? loader.currentItem.item : null;
33+ }
34+ return null;
35+ }
36+ property int currentIndex: 0
3037 property real scopeScale: 1
3138 property QtObject scopeStyle: QtObject {
3239 property string headerLogo: ""
@@ -211,6 +218,7 @@ Item {
211218 item.scopeWidth = root.width;
212219 item.scopeHeight = root.height;
213220 item.appliedScale = Qt.binding(function() { return loader.scale })
221+ item.currentIndex = Qt.binding(function() { return root.currentIndex }) // TODO Move down
214222 } else if (index == 1) {
215223 item.extraHeight = bottomBar.height;
216224 }