@@ -16,6 +16,7 @@
17import QtQuick 2.2
17import QtQuick 2.2
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19+import Ubuntu.Components.ListItems 0.1 as ListItem
19import "../Components"
20import "../Components"
@@ -58,13 +59,9 @@ Item {
58 id: column
59 id: column
59 width: parent.width
60 width: parent.width
61− // TODO: check if SDK ListItems could be used here
62+ ListItem.Standard {
62− // and if not make them be useful since this is a quite common pattern
65 id: backButton
63 id: backButton
66 objectName: "backButton"
64 objectName: "backButton"
68 visible: navigation && !navigation.isRoot || false
65 visible: navigation && !navigation.isRoot || false
69 height: itemHeight
66 height: itemHeight
@@ -97,25 +94,11 @@ Item {
97 maximumLineCount: 2
94 maximumLineCount: 2
98 elide: Text.ElideMiddle
95 elide: Text.ElideMiddle
103− bottom: parent.bottom
106− leftMargin: units.gu(2)
107− rightMargin: units.gu(2)
109− color: root.foregroundColor
115− AbstractButton {
99+ ListItem.Standard {
116 id: allButton
100 id: allButton
117 objectName: "allButton"
101 objectName: "allButton"
119 visible: navigation && (!navigation.isRoot || (!navigation.hidden && root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false
102 visible: navigation && (!navigation.isRoot || (!navigation.hidden && root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false
120 height: itemHeight
103 height: itemHeight
@@ -135,29 +118,17 @@ Item {
135 elide: Text.ElideMiddle
118 elide: Text.ElideMiddle
140− bottom: parent.bottom
143− leftMargin: units.gu(2)
144− rightMargin: units.gu(2)
146− color: root.foregroundColor
151 onClicked: root.allNavigationClicked();
121 onClicked: root.allNavigationClicked();
154 Repeater {
124 Repeater {
155 model: navigation && navigation.loaded ? navigation : null
125 model: navigation && navigation.loaded ? navigation : null
156 clip: true
126 clip: true
157− delegate: AbstractButton {
127+ delegate: ListItem.Standard {
158 objectName: root.objectName + "child" + index
128 objectName: root.objectName + "child" + index
159 height: root.itemHeight
129 height: root.itemHeight
160− width: root.width
130+ showDivider: index != navigation.count - 1
162 onClicked: root.enterNavigation(navigationId, hasChildren)
133 onClicked: root.enterNavigation(navigationId, hasChildren)
@@ -189,20 +160,6 @@ Item {
189 color: root.foregroundColor
160 color: root.foregroundColor
190 visible: hasChildren || isActive
161 visible: hasChildren || isActive
195− bottom: parent.bottom
198− leftMargin: units.gu(2)
199− rightMargin: units.gu(2)
201− color: root.foregroundColor
204− visible: index != navigation.count - 1