on xenial help sign in
Added touch state on navigation. Fixes: #1383213

Approved by: Mirco Müller

commit298f751879cf4b7a5769e06d4f7051233c9e1e6b authorhandsome_feng <445865575@qq.com> dateTue 21 Jul 2015, 09:09 (11 years ago) parent8f39abdb7742ab
1 file changed+6−49
qml/Dash/DashNavigationList.qml+6−49
qml/Dash/DashNavigationList.qml+6−49
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.2
1818import Ubuntu.Components 1.1
19+import Ubuntu.Components.ListItems 0.1 as ListItem
1920import "../Components"
2021
2122Item {
@@ -58,13 +59,9 @@ Item {
5859 id: column
5960 width: parent.width
6061
61− // TODO: check if SDK ListItems could be used here
62− // and if not make them be useful since this is a quite common pattern
63−
64− AbstractButton {
62+ ListItem.Standard {
6563 id: backButton
6664 objectName: "backButton"
67− width: parent.width
6865 visible: navigation && !navigation.isRoot || false
6966 height: itemHeight
7067
@@ -97,25 +94,11 @@ Item {
9794 maximumLineCount: 2
9895 elide: Text.ElideMiddle
9996 }
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− }
11397 }
11498
115− AbstractButton {
99+ ListItem.Standard {
116100 id: allButton
117101 objectName: "allButton"
118− width: parent.width
119102 visible: navigation && (!navigation.isRoot || (!navigation.hidden && root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false
120103 height: itemHeight
121104
@@ -135,29 +118,17 @@ Item {
135118 elide: Text.ElideMiddle
136119 }
137120
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−
151121 onClicked: root.allNavigationClicked();
152122 }
153123
154124 Repeater {
155125 model: navigation && navigation.loaded ? navigation : null
156126 clip: true
157− delegate: AbstractButton {
127+ delegate: ListItem.Standard {
158128 objectName: root.objectName + "child" + index
159129 height: root.itemHeight
160− width: root.width
130+ showDivider: index != navigation.count - 1
131+ selected: isActive
161132
162133 onClicked: root.enterNavigation(navigationId, hasChildren)
163134
@@ -189,20 +160,6 @@ Item {
189160 color: root.foregroundColor
190161 visible: hasChildren || isActive
191162 }
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− }
206163 }
207164 }
208165 }