on xenial help sign in
If the navigation we're reaching is a child, list the parent not itself
3ea41b4Albert Astals
qml/Dash/DashNavigationButton.qml+13−2
@@ -184,10 +184,16 @@ AbstractButton {
184 Connections {
184 Connections {
185 target: scope
185 target: scope
186 // This is duplicated since we can't have something based on the dynamic hasNavigation string property
186 // 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
187 onHasNavigationChanged: {
188 onHasNavigationChanged: {
188 if (!root.isAltNavigation) {
189 if (!root.isAltNavigation) {
189 if (scope.hasNavigation) {
190 if (scope.hasNavigation) {
191+ var navigation = scope.getNavigation(scope.currentNavigationId);
192+ if (navigation.count > 0) {
190− navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
193+ navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
194+ } else {
195+ navigationModel.append({"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
196+ }
191 } else {
197 } else {
192 navigationModel.clear();
198 navigationModel.clear();
193 }
199 }
@@ -196,7 +202,12 @@ AbstractButton {
196 onHasAltNavigationChanged: {
202 onHasAltNavigationChanged: {
197 if (root.isAltNavigation) {
203 if (root.isAltNavigation) {
198 if (scope.hasAltNavigation) {
204 if (scope.hasAltNavigation) {
205+ var navigation = scope.getAltNavigation(scope.currentAltNavigationId);
206+ if (navigation.count > 0) {
199− navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
207+ navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
208+ } else {
209+ navigationModel.append({"navigationId": navigation.parentNavigationId, "nullifyNavigation": false});
210+ }
200 } else {
211 } else {
201 navigationModel.clear();
212 navigationModel.clear();
202 }
213 }