on xenial help sign in
If the navigation we're reaching is a child, list the parent not itself
commit3ea41b4986d6fb3f210eff04ceb7afc766dcf0ff authorAlbert Astals <albert.astals@canonical.com> dateWed 3 Dec 2014, 17:22 (12 years ago) parent57f15d1
1 file changed+13−2
qml/Dash/DashNavigationButton.qml+13−2
qml/Dash/DashNavigationButton.qml+13−2
@@ -184,10 +184,16 @@ AbstractButton {
184184 Connections {
185185 target: scope
186186 // This is duplicated since we can't have something based on the dynamic hasNavigation string property
187+ // TODO Try to merge these two together a bit more
187188 onHasNavigationChanged: {
188189 if (!root.isAltNavigation) {
189190 if (scope.hasNavigation) {
190− navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
191+ var navigation = scope.getNavigation(scope.currentNavigationId);
192+ if (navigation.count > 0) {
193+ navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
194+ } else {
195+ navigationModel.append({"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
196+ }
191197 } else {
192198 navigationModel.clear();
193199 }
@@ -196,7 +202,12 @@ AbstractButton {
196202 onHasAltNavigationChanged: {
197203 if (root.isAltNavigation) {
198204 if (scope.hasAltNavigation) {
199− navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
205+ var navigation = scope.getAltNavigation(scope.currentAltNavigationId);
206+ if (navigation.count > 0) {
207+ navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
208+ } else {
209+ navigationModel.append({"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
210+ }
200211 } else {
201212 navigationModel.clear();
202213 }