on xenial help sign in
remove the leftMargin/rightMargin of the Standard item
commitccfe1047f3dcc785967cdc9ea3587b3415af4dfa authorhandsome_feng <445865575@qq.com> dateMon 6 Jul 2015, 12:41 (11 years ago) parente372caa
1 file changed+6−53
qml/Dash/DashNavigationList.qml+6−53
qml/Dash/DashNavigationList.qml+6−53
@@ -59,13 +59,9 @@ Item {
5959 id: column
6060 width: parent.width
6161
62− // TODO: check if SDK ListItems could be used here
63− // and if not make them be useful since this is a quite common pattern
64−
65− AbstractButton {
62+ ListItem.Standard {
6663 id: backButton
6764 objectName: "backButton"
68− width: parent.width
6965 visible: navigation && !navigation.isRoot || false
7066 height: itemHeight
7167
@@ -98,25 +94,11 @@ Item {
9894 maximumLineCount: 2
9995 elide: Text.ElideMiddle
10096 }
101−
102− Rectangle {
103− anchors {
104− bottom: parent.bottom
105− left: parent.left
106− right: parent.right
107− leftMargin: units.gu(2)
108− rightMargin: units.gu(2)
109− }
110− color: root.foregroundColor
111− opacity: 0.2
112− height: units.dp(1)
113− }
11497 }
11598
116− AbstractButton {
99+ ListItem.Standard {
117100 id: allButton
118101 objectName: "allButton"
119− width: parent.width
120102 visible: navigation && (!navigation.isRoot || (!navigation.hidden && root.currentNavigation && !root.currentNavigation.isRoot && root.currentNavigation.parentNavigationId == navigation.navigationId)) || false
121103 height: itemHeight
122104
@@ -136,19 +118,6 @@ Item {
136118 elide: Text.ElideMiddle
137119 }
138120
139− Rectangle {
140− anchors {
141− bottom: parent.bottom
142− left: parent.left
143− right: parent.right
144− leftMargin: units.gu(2)
145− rightMargin: units.gu(2)
146− }
147− color: root.foregroundColor
148− opacity: 0.2
149− height: units.dp(1)
150− }
151−
152121 onClicked: root.allNavigationClicked();
153122 }
154123
@@ -158,13 +127,7 @@ Item {
158127 delegate: ListItem.Standard {
159128 objectName: root.objectName + "child" + index
160129 height: root.itemHeight
161− anchors {
162− left: parent.left
163− right: parent.right
164− leftMargin: units.gu(2)
165− rightMargin: units.gu(2)
166− }
167− showDivider: false
130+ showDivider: index != navigation.count - 1
168131 selected: isActive
169132
170133 onClicked: root.enterNavigation(navigationId, hasChildren)
@@ -173,8 +136,9 @@ Item {
173136 anchors {
174137 verticalCenter: parent.verticalCenter
175138 left: parent.left
139+ leftMargin: units.gu(2)
176140 right: rightIcon.visible ? rightIcon.left : parent.right
177− rightMargin: rightIcon.visible ? units.gu(0.5) : 0
141+ rightMargin: rightIcon.visible ? units.gu(0.5) : units.gu(2)
178142 }
179143 text: label
180144 color: root.foregroundColor
@@ -188,6 +152,7 @@ Item {
188152 anchors {
189153 verticalCenter: parent.verticalCenter
190154 right: parent.right
155+ rightMargin: units.gu(2)
191156 }
192157 height: units.gu(2)
193158 width: height
@@ -195,18 +160,6 @@ Item {
195160 color: root.foregroundColor
196161 visible: hasChildren || isActive
197162 }
198−
199− Rectangle {
200− anchors {
201− bottom: parent.bottom
202− left: parent.left
203− right: parent.right
204− }
205− color: root.foregroundColor
206− opacity: 0.1
207− height: units.dp(1)
208− visible: index != navigation.count - 1
209− }
210163 }
211164 }
212165 }