on xenial help sign in
Group anchors
cbed9e7Albert Astals
qml/Dash/DashDepartmentsList.qml+51−36
@@ -70,9 +70,11 @@ Item {
70
70
71 Image {
71 Image {
72 id: backImage
72 id: backImage
73+ anchors {
73− anchors.verticalCenter: parent.verticalCenter
74+ verticalCenter: parent.verticalCenter
74− anchors.left: parent.left
75+ left: parent.left
75− anchors.leftMargin: units.gu(2)
76+ leftMargin: units.gu(2)
77+ }
76 source: "image://theme/back"
78 source: "image://theme/back"
77 sourceSize.height: parent.height - units.gu(3)
79 sourceSize.height: parent.height - units.gu(3)
78 sourceSize.width: units.gu(3)
80 sourceSize.width: units.gu(3)
@@ -80,20 +82,23 @@ Item {
80 }
82 }
81
83
82 Label {
84 Label {
85+ anchors {
83− anchors.verticalCenter: parent.verticalCenter
86+ verticalCenter: parent.verticalCenter
84− anchors.left: backImage.right
87+ left: backImage.right
85− anchors.leftMargin: units.gu(0.5)
88+ leftMargin: units.gu(0.5)
89+ }
86 text: department ? department.parentLabel : ""
90 text: department ? department.parentLabel : ""
87 color: "gray" // TODO remove once we're a separate app
91 color: "gray" // TODO remove once we're a separate app
88 }
92 }
89
93
90 Rectangle {
94 Rectangle {
95+ anchors {
91− anchors.bottom: parent.bottom
96+ bottom: parent.bottom
92− anchors.left: parent.left
97+ left: parent.left
93− anchors.right: parent.right
98+ right: parent.right
94− anchors.leftMargin: units.gu(2)
99+ leftMargin: units.gu(2)
95− anchors.rightMargin: units.gu(2)
100+ rightMargin: units.gu(2)
96− width: parent.width
101+ }
97 color: "gray"
102 color: "gray"
98 opacity: 0.2
103 opacity: 0.2
99 height: units.dp(1)
104 height: units.dp(1)
@@ -108,21 +113,24 @@ Item {
108 height: itemHeight
113 height: itemHeight
109
114
110 Label {
115 Label {
116+ anchors {
111− anchors.verticalCenter: parent.verticalCenter
117+ verticalCenter: parent.verticalCenter
112− anchors.left: parent.left
118+ left: parent.left
113− anchors.leftMargin: units.gu(2)
119+ leftMargin: units.gu(2)
120+ }
114 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
121 text: department ? (department.allLabel != "" ? department.allLabel : department.label) : ""
115 font.bold: true
122 font.bold: true
116 color: "gray" // TODO remove once we're a separate app
123 color: "gray" // TODO remove once we're a separate app
117 }
124 }
118
125
119 Rectangle {
126 Rectangle {
127+ anchors {
120− anchors.bottom: parent.bottom
128+ bottom: parent.bottom
121− anchors.left: parent.left
129+ left: parent.left
122− anchors.right: parent.right
130+ right: parent.right
123− anchors.leftMargin: units.gu(2)
131+ leftMargin: units.gu(2)
124− anchors.rightMargin: units.gu(2)
132+ rightMargin: units.gu(2)
125− width: parent.width
133+ }
126 color: "gray"
134 color: "gray"
127 opacity: 0.2
135 opacity: 0.2
128 height: units.dp(1)
136 height: units.dp(1)
@@ -142,17 +150,21 @@ Item {
142 onClicked: root.enterDepartment(departmentId, hasChildren)
150 onClicked: root.enterDepartment(departmentId, hasChildren)
143
151
144 Label {
152 Label {
153+ anchors {
145− anchors.verticalCenter: parent.verticalCenter
154+ verticalCenter: parent.verticalCenter
146− anchors.left: parent.left
155+ left: parent.left
147− anchors.leftMargin: units.gu(2)
156+ leftMargin: units.gu(2)
157+ }
148 text: label
158 text: label
149 color: "gray" // TODO remove once we're a separate app
159 color: "gray" // TODO remove once we're a separate app
150 }
160 }
151
161
152 Image {
162 Image {
163+ anchors {
153− anchors.verticalCenter: parent.verticalCenter
164+ verticalCenter: parent.verticalCenter
154− anchors.right: parent.right
165+ right: parent.right
155− anchors.rightMargin: units.gu(2)
166+ rightMargin: units.gu(2)
167+ }
156 source: "image://theme/chevron"
168 source: "image://theme/chevron"
157 sourceSize.height: parent.height - units.gu(3)
169 sourceSize.height: parent.height - units.gu(3)
158 sourceSize.width: units.gu(3)
170 sourceSize.width: units.gu(3)
@@ -160,9 +172,11 @@ Item {
160 visible: hasChildren
172 visible: hasChildren
161 }
173 }
162 Image {
174 Image {
175+ anchors {
163− anchors.verticalCenter: parent.verticalCenter
176+ verticalCenter: parent.verticalCenter
164− anchors.right: parent.right
177+ right: parent.right
165− anchors.rightMargin: units.gu(2)
178+ rightMargin: units.gu(2)
179+ }
166 source: "graphics/tick.png"
180 source: "graphics/tick.png"
167 sourceSize.height: parent.height - units.gu(2)
181 sourceSize.height: parent.height - units.gu(2)
168 sourceSize.width: units.gu(3)
182 sourceSize.width: units.gu(3)
@@ -171,12 +185,13 @@ Item {
171 }
185 }
172
186
173 Rectangle {
187 Rectangle {
188+ anchors {
174− anchors.bottom: parent.bottom
189+ bottom: parent.bottom
175− anchors.left: parent.left
190+ left: parent.left
176− anchors.right: parent.right
191+ right: parent.right
177− anchors.leftMargin: units.gu(2)
192+ leftMargin: units.gu(2)
178− anchors.rightMargin: units.gu(2)
193+ rightMargin: units.gu(2)
179− width: parent.width
194+ }
180 color: "gray"
195 color: "gray"
181 opacity: 0.1
196 opacity: 0.1
182 height: units.dp(1)
197 height: units.dp(1)