@@ -21,59 +21,35 @@ AbstractButton {
22 objectName: "dashNavigation"
22 objectName: "dashNavigation"
24 property var scope: null
25 property var scope: null
26+ property var scopeStyle: null
27+ property bool isAltNavigation: false
30+ readonly property var currentNavigation: scope && scope[hasNavigation] ? getNavigation(scope[currentNavigationId]) : null
31+ readonly property alias listView: navigationListView
26 property bool showList: false
32 property bool showList: false
28− readonly property var currentNavigation: scope && scope.hasNavigation ? scope.getNavigation(scope.currentNavigationId) : null
34+ // Internal
30− property alias windowWidth: blackRect.width
31− property alias windowHeight: blackRect.height
32− property var scopeStyle: null
34 // Are we drilling down the tree or up?
35 // Are we drilling down the tree or up?
35 property bool isGoingBack: false
36 property bool isGoingBack: false
37+ readonly property string hasNavigation: isAltNavigation ? "hasAltNavigation" : "hasNavigation"
38+ readonly property string currentNavigationId: isAltNavigation ? "currentAltNavigationId" : "currentNavigationId"
39+ function getNavigation(navId) {
40+ if (isAltNavigation) {
41+ return scope.getAltNavigation(navId);
43+ return scope.getNavigation(navId);
37 visible: root.currentNavigation != null
47 visible: root.currentNavigation != null
39− height: visible ? units.gu(5) : 0
41 onClicked: {
49 onClicked: {
42 root.showList = !root.showList;
50 root.showList = !root.showList;
48− opacity: navigationListView.currentItem && navigationListView.currentItem.visible ? 0.3 : 0
49− Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
50− anchors.top: navigationListView.top
51− anchors.right: parent.right
52− visible: opacity != 0
61− fillMode: Image.Stretch
62− source: "graphics/dash_divider_top_lightgrad.png"
68− bottom: parent.bottom
72− fillMode: Image.Stretch
73− source: "graphics/dash_divider_top_darkgrad.png"
78 anchors.fill: parent
54 anchors.fill: parent
79 anchors.margins: units.gu(2)
55 anchors.margins: units.gu(2)
@@ -106,11 +82,7 @@ AbstractButton {
106 // nullifyNavigation: overrides navigationId to be null
82 // nullifyNavigation: overrides navigationId to be null
107 // This is used to "clear" the delegate when going "right" on the tree
83 // This is used to "clear" the delegate when going "right" on the tree
112− top: root.bottom
85+ anchors.top: root.bottom
114 readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8)
86 readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8)
115 property int prevHeight: maxHeight
87 property int prevHeight: maxHeight
116 height: currentItem ? currentItem.height : maxHeight
88 height: currentItem ? currentItem.height : maxHeight
@@ -138,7 +110,7 @@ AbstractButton {
140 height: desiredHeight
112 height: desiredHeight
141− navigation: (nullifyNavigation || !scope) ? null : scope.getNavigation(navigationId)
113+ navigation: (nullifyNavigation || !scope) ? null : getNavigation(navigationId)
142 currentNavigation: root.currentNavigation
114 currentNavigation: root.currentNavigation
143 onEnterNavigation: {
115 onEnterNavigation: {
144 scope.performQuery(navigationQuery);
116 scope.performQuery(navigationQuery);
@@ -177,27 +149,39 @@ AbstractButton {
181− anchors.fill: navigationListView
182− enabled: root.showList
183− onClicked: root.showList = false
186 onScopeChanged: {
152 onScopeChanged: {
187 navigationModel.clear();
153 navigationModel.clear();
188− if (scope && scope.hasNavigation) {
154+ if (scope && scope[hasNavigation]) {
189− navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
155+ navigationModel.append({"navigationId": scope[currentNavigationId], "nullifyNavigation": false});
193 Connections {
159 Connections {
194 target: scope
160 target: scope
161+ // This is duplicated since we can't have something based on the dynamic hasNavigation string property
195 onHasNavigationChanged: {
162 onHasNavigationChanged: {
163+ if (!root.isAltNavigation) {
196− if (scope.hasNavigation) {
164+ if (scope.hasNavigation) {
197− navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
165+ navigationModel.append({"navigationId": scope.currentNavigationId, "nullifyNavigation": false});
198− } else {
166+ } else {
199− navigationModel.clear();
167+ navigationModel.clear();
171+ onHasAltNavigationChanged: {
172+ if (root.isAltNavigation) {
173+ if (scope.hasAltNavigation) {
174+ navigationModel.append({"navigationId": scope.currentAltNavigationId, "nullifyNavigation": false});
176+ navigationModel.clear();
183+ anchors.fill: navigationListView
184+ enabled: root.showList
185+ onClicked: root.showList = false