@@ -139,6 +139,17 @@ AbstractButton {
139139 }
140140 }
141141 onGoBackToParentClicked: {
142+ if (navigationListView.currentIndex == 0) {
143+ // This can happen if we jumped to the non root of a deep tree and the user
144+ // is now going back, create space in the list for the list to move "left"
145+ var aux = navigationListView.highlightMoveDuration;
146+ navigationListView.highlightMoveDuration = 0;
147+ navigationModel.insert(0, {"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
148+ navigationListView.currentIndex = navigationListView.currentIndex + 1;
149+ navigationListView.contentX = width * navigationListView.currentIndex;
150+ navigationListView.highlightMoveDuration = aux;
151+ }
152+
142153 scope.setNavigationState(navigation.parentNavigationId, isAltNavigation);
143154 isGoingBack = true;
144155 navigationModel.setProperty(navigationListView.currentIndex - 1, "nullifyNavigation", false);
@@ -153,6 +164,9 @@ AbstractButton {
153164 }
154165 }
155166 onContentXChanged: {
167+ if (navigationListView.highlightMoveDuration == 0)
168+ return;
169+
156170 if (contentX == width * navigationListView.currentIndex) {
157171 if (isGoingBack) {
158172 navigationModel.remove(navigationListView.currentIndex + 1);
@@ -175,9 +189,18 @@ AbstractButton {
175189 }
176190
177191 onScopeChanged: {
192+ setNewNavigation();
193+ }
194+
195+ function setNewNavigation() {
178196 navigationModel.clear();
179197 if (scope && scope[hasNavigation]) {
180− navigationModel.append({"navigationId": scope[currentNavigationId], "nullifyNavigation": false});
198+ var navigation = getNavigation(scope[currentNavigationId]);
199+ if (navigation.count > 0) {
200+ navigationModel.append({"navigationId": scope[currentNavigationId], "nullifyNavigation": false});
201+ } else {
202+ navigationModel.append({"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
203+ }
181204 }
182205 }
183206
@@ -186,20 +209,12 @@ AbstractButton {
186209 // This is duplicated since we can't have something based on the dynamic hasNavigation string property
187210 onHasNavigationChanged: {
188211 if (!root.isAltNavigation) {
189− if (scope.hasNavigation) {
190− navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
191− } else {
192− navigationModel.clear();
193− }
212+ setNewNavigation();
194213 }
195214 }
196215 onHasAltNavigationChanged: {
197216 if (root.isAltNavigation) {
198− if (scope.hasAltNavigation) {
199− navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
200− } else {
201− navigationModel.clear();
202− }
217+ setNewNavigation();
203218 }
204219 }
205220 }