@@ -52,8 +52,25 @@ Item {
5252
5353 Column {
5454 id: headersColumn
55− anchors.top: parent.top
56− width: parent.width
55+ anchors {
56+ top: parent.top
57+ left: parent.left
58+ right: parent.right
59+ }
60+
61+ function pop(popsNeeded) {
62+ if (popsNeeded == 0)
63+ return;
64+ isEnteringChildren = false;
65+ navigationListView.currentIndex = navigationListView.currentIndex - popsNeeded;
66+ navigationModel.setProperty(navigationListView.currentIndex, "nullifyNavigation", false);
67+ navigationModel.remove(navigationModel.count - popsNeeded, popsNeeded);
68+
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);
72+ }
73+
5774 Repeater {
5875 model: ListModel {
5976 id: headersModel
@@ -71,31 +88,18 @@ Item {
7188 text: headerText
7289 foregroundColor: d.foregroundColor
7390
74− function pop(popsNeeded) {
75− if (popsNeeded == 0)
76− return;
77− isEnteringChildren = false;
78− navigationListView.currentIndex = navigationListView.currentIndex - popsNeeded;
79− navigationModel.setProperty(navigationListView.currentIndex, "nullifyNavigation", false);
80− navigationModel.remove(navigationModel.count - popsNeeded, popsNeeded);
81−
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);
85− }
86−
8791 onBackClicked: {
8892 scope.setNavigationState(parentNavigationId);
8993
9094 var popsNeeded = headersModel.count - index;
91− pop(popsNeeded);
95+ headersColumn.pop(popsNeeded);
9296 }
9397
9498 onTextClicked: {
9599 scope.setNavigationState(navigationId);
96100
97101 var popsNeeded = headersModel.count - index - 1;
98− pop(popsNeeded);
102+ headersColumn.pop(popsNeeded);
99103
100104 root.leafClicked();
101105 }
@@ -115,7 +119,11 @@ Item {
115119 // nullifyNavigation: overrides navigationId to be null
116120 // This is used to "clear" the delegate when going "right" on the tree
117121 }
118− anchors.top: headersColumn.bottom
122+ anchors {
123+ top: headersColumn.bottom
124+ left: parent.left
125+ right: parent.right
126+ }
119127 property int maxHeight: -1
120128 Component.onCompleted: updateMaxHeight();
121129 function updateMaxHeight()
@@ -124,7 +132,6 @@ Item {
124132 }
125133 property int prevHeight: maxHeight
126134 height: currentItem ? currentItem.height : maxHeight
127− width: parent.width
128135
129136 onHeightChanged: {
130137 if (currentItem) {