on xenial help sign in
Added touch state on navigation. Fixes: #1383213
298f751handsome_feng
qml/Dash/DashNavigationList.qml+6−49
@@ -16,6 +16,7 @@
16
16
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"
20
21
21Item {
22Item {
@@ -58,13 +59,9 @@ Item {
58 id: column
59 id: column
59 width: parent.width
60 width: parent.width
60
61
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
63−
64− AbstractButton {
65 id: backButton
63 id: backButton
66 objectName: "backButton"
64 objectName: "backButton"
67− width: parent.width
68 visible: navigation && !navigation.isRoot || false
65 visible: navigation && !navigation.isRoot || false
69 height: itemHeight
66 height: itemHeight
70
67
@@ -97,25 +94,11 @@ Item {
97 maximumLineCount: 2
94 maximumLineCount: 2
98 elide: Text.ElideMiddle
95 elide: Text.ElideMiddle
99 }
96 }
100−
101− Rectangle {
102− anchors {
103− bottom: parent.bottom
104− left: parent.left
105− right: parent.right
106− leftMargin: units.gu(2)
107− rightMargin: units.gu(2)
108− }
109− color: root.foregroundColor
110− opacity: 0.2
111− height: units.dp(1)
112− }
113 }
97 }
114
98
115− AbstractButton {
99+ ListItem.Standard {
116 id: allButton
100 id: allButton
117 objectName: "allButton"
101 objectName: "allButton"
118− width: parent.width
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
121
104
@@ -135,29 +118,17 @@ Item {
135 elide: Text.ElideMiddle
118 elide: Text.ElideMiddle
136 }
119 }
137
120
138− Rectangle {
139− anchors {
140− bottom: parent.bottom
141− left: parent.left
142− right: parent.right
143− leftMargin: units.gu(2)
144− rightMargin: units.gu(2)
145− }
146− color: root.foregroundColor
147− opacity: 0.2
148− height: units.dp(1)
149− }
150−
151 onClicked: root.allNavigationClicked();
121 onClicked: root.allNavigationClicked();
152 }
122 }
153
123
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
131+ selected: isActive
161
132
162 onClicked: root.enterNavigation(navigationId, hasChildren)
133 onClicked: root.enterNavigation(navigationId, hasChildren)
163
134
@@ -189,20 +160,6 @@ Item {
189 color: root.foregroundColor
160 color: root.foregroundColor
190 visible: hasChildren || isActive
161 visible: hasChildren || isActive
191 }
162 }
192−
193− Rectangle {
194− anchors {
195− bottom: parent.bottom
196− left: parent.left
197− right: parent.right
198− leftMargin: units.gu(2)
199− rightMargin: units.gu(2)
200− }
201− color: root.foregroundColor
202− opacity: 0.1
203− height: units.dp(1)
204− visible: index != navigation.count - 1
205− }
206 }
163 }
207 }
164 }
208 }
165 }