@@ -52,8 +52,25 @@ Item {
54 id: headersColumn
54 id: headersColumn
55− anchors.top: parent.top
56+ top: parent.top
56− width: parent.width
57+ left: parent.left
61+ function pop(popsNeeded) {
64+ isEnteringChildren = false;
65+ navigationListView.currentIndex = navigationListView.currentIndex - popsNeeded;
66+ navigationModel.setProperty(navigationListView.currentIndex, "nullifyNavigation", false);
67+ navigationModel.remove(navigationModel.count - popsNeeded, popsNeeded);
69+ popsNeeded = Math.min(headersModel.count, popsNeeded);
70+ // This is effectively deleting ourselves, so needs to be the last thing of the function
71+ headersModel.remove(headersModel.count - popsNeeded, popsNeeded);
57 Repeater {
74 Repeater {
58 model: ListModel {
75 model: ListModel {
59 id: headersModel
76 id: headersModel
@@ -71,31 +88,18 @@ Item {
71 text: headerText
88 text: headerText
72 foregroundColor: d.foregroundColor
89 foregroundColor: d.foregroundColor
74− function pop(popsNeeded) {
77− isEnteringChildren = false;
78− navigationListView.currentIndex = navigationListView.currentIndex - popsNeeded;
79− navigationModel.setProperty(navigationListView.currentIndex, "nullifyNavigation", false);
80− navigationModel.remove(navigationModel.count - popsNeeded, popsNeeded);
82− popsNeeded = Math.min(headersModel.count, popsNeeded);
83− // This is effectively deleting ourselves, so needs to be the last thing of the function
84− headersModel.remove(headersModel.count - popsNeeded, popsNeeded);
87 onBackClicked: {
91 onBackClicked: {
88 scope.setNavigationState(parentNavigationId);
92 scope.setNavigationState(parentNavigationId);
90 var popsNeeded = headersModel.count - index;
94 var popsNeeded = headersModel.count - index;
91− pop(popsNeeded);
95+ headersColumn.pop(popsNeeded);
94 onTextClicked: {
98 onTextClicked: {
95 scope.setNavigationState(navigationId);
99 scope.setNavigationState(navigationId);
97 var popsNeeded = headersModel.count - index - 1;
101 var popsNeeded = headersModel.count - index - 1;
98− pop(popsNeeded);
102+ headersColumn.pop(popsNeeded);
100 root.leafClicked();
104 root.leafClicked();
@@ -115,7 +119,11 @@ Item {
115 // nullifyNavigation: overrides navigationId to be null
119 // nullifyNavigation: overrides navigationId to be null
116 // This is used to "clear" the delegate when going "right" on the tree
120 // This is used to "clear" the delegate when going "right" on the tree
118− anchors.top: headersColumn.bottom
123+ top: headersColumn.bottom
119 property int maxHeight: -1
127 property int maxHeight: -1
120 Component.onCompleted: updateMaxHeight();
128 Component.onCompleted: updateMaxHeight();
121 function updateMaxHeight()
129 function updateMaxHeight()
@@ -124,7 +132,6 @@ Item {
125 property int prevHeight: maxHeight
133 property int prevHeight: maxHeight
126 height: currentItem ? currentItem.height : maxHeight
134 height: currentItem ? currentItem.height : maxHeight
129 onHeightChanged: {
136 onHeightChanged: {
130 if (currentItem) {
137 if (currentItem) {