Changeset View
Changeset View
Standalone View
Standalone View
src/controls/templates/OverlayDrawer.qml
Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 200 | if (typeof applicationWindow === "undefined") { | |||
---|---|---|---|---|---|
201 | return; | 201 | return; | ||
202 | } | 202 | } | ||
203 | 203 | | |||
204 | var margin = Units.smallSpacing; | 204 | var margin = Units.smallSpacing; | ||
205 | if (applicationWindow().footer) { | 205 | if (applicationWindow().footer) { | ||
206 | margin = applicationWindow().footer.height + Units.smallSpacing; | 206 | margin = applicationWindow().footer.height + Units.smallSpacing; | ||
207 | } | 207 | } | ||
208 | 208 | | |||
209 | if(root.height < root.parent.height) { | ||||
210 | margin = root.parent.height - root.height - root.y + Units.smallSpacing; | ||||
mart: applicationWindow() should be replaceable with root.parent, and that makes it work also when… | |||||
211 | } | ||||
212 | | ||||
209 | if (!applicationWindow() || !applicationWindow().pageStack || | 213 | if (!applicationWindow() || !applicationWindow().pageStack || | ||
210 | !applicationWindow().pageStack.contentItem || | 214 | !applicationWindow().pageStack.contentItem || | ||
211 | !applicationWindow().pageStack.contentItem.itemAt) { | 215 | !applicationWindow().pageStack.contentItem.itemAt) { | ||
212 | return margin; | 216 | return margin; | ||
213 | } | 217 | } | ||
214 | 218 | | |||
215 | var item; | 219 | var item; | ||
216 | if (applicationWindow().pageStack.layers.depth > 1) { | 220 | if (applicationWindow().pageStack.layers.depth > 1) { | ||
217 | item = applicationWindow().pageStack.layers.currentItem; | 221 | item = applicationWindow().pageStack.layers.currentItem; | ||
218 | } else { | 222 | } else { | ||
219 | item = applicationWindow().pageStack.contentItem.itemAt(applicationWindow().pageStack.contentItem.contentX + drawerHandle.x, 0); | 223 | item = applicationWindow().pageStack.contentItem.itemAt(applicationWindow().pageStack.contentItem.contentX + drawerHandle.x, 0); | ||
220 | } | 224 | } | ||
221 | 225 | | |||
222 | //try to take the last item | 226 | //try to take the last item | ||
223 | if (!item) { | 227 | if (!item) { | ||
224 | item = applicationWindow().pageStack.lastItem; | 228 | item = applicationWindow().pageStack.lastItem; | ||
225 | } | 229 | } | ||
226 | 230 | | |||
227 | var pageFooter = item && item.page ? item.page.footer : (item ? item.footer : undefined); | 231 | var pageFooter = item && item.page ? item.page.footer : (item ? item.footer : undefined); | ||
228 | if (pageFooter) { | 232 | if (pageFooter) { | ||
229 | margin += pageFooter.height; | 233 | margin = root.height < root.parent.height ? margin : margin + pageFooter.height | ||
230 | } | 234 | } | ||
231 | 235 | | |||
232 | return margin; | 236 | return margin; | ||
233 | } | 237 | } | ||
234 | Behavior on bottomMargin { | 238 | Behavior on bottomMargin { | ||
235 | NumberAnimation { | 239 | NumberAnimation { | ||
236 | duration: Units.shortDuration | 240 | duration: Units.shortDuration | ||
237 | easing.type: Easing.InOutQuad | 241 | easing.type: Easing.InOutQuad | ||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |
applicationWindow() should be replaceable with root.parent, and that makes it work also when not in a kirigami applicationwindow