@@ -54,6 +54,20 @@ Item {
54 id: headersColumn
54 id: headersColumn
55 anchors.top: parent.top
55 anchors.top: parent.top
56 width: parent.width
56 width: parent.width
58+ function pop(popsNeeded) {
61+ isEnteringChildren = false;
62+ navigationListView.currentIndex = navigationListView.currentIndex - popsNeeded;
63+ navigationModel.setProperty(navigationListView.currentIndex, "nullifyNavigation", false);
64+ navigationModel.remove(navigationModel.count - popsNeeded, popsNeeded);
66+ popsNeeded = Math.min(headersModel.count, popsNeeded);
67+ // This is effectively deleting ourselves, so needs to be the last thing of the function
68+ headersModel.remove(headersModel.count - popsNeeded, popsNeeded);
57 Repeater {
71 Repeater {
58 model: ListModel {
72 model: ListModel {
59 id: headersModel
73 id: headersModel
@@ -71,31 +85,18 @@ Item {
71 text: headerText
85 text: headerText
72 foregroundColor: d.foregroundColor
86 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: {
88 onBackClicked: {
88 scope.setNavigationState(parentNavigationId);
89 scope.setNavigationState(parentNavigationId);
90 var popsNeeded = headersModel.count - index;
91 var popsNeeded = headersModel.count - index;
91− pop(popsNeeded);
92+ headersColumn.pop(popsNeeded);
94 onTextClicked: {
95 onTextClicked: {
95 scope.setNavigationState(navigationId);
96 scope.setNavigationState(navigationId);
97 var popsNeeded = headersModel.count - index - 1;
98 var popsNeeded = headersModel.count - index - 1;
98− pop(popsNeeded);
99+ headersColumn.pop(popsNeeded);
100 root.leafClicked();
101 root.leafClicked();