Changeset View
Changeset View
Standalone View
Standalone View
src/controls/templates/OverlaySheet.qml
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 26 | QtObject { | |||
---|---|---|---|---|---|
100 | */ | 100 | */ | ||
101 | property real bottomInset: 0 | 101 | property real bottomInset: 0 | ||
102 | 102 | | |||
103 | /** | 103 | /** | ||
104 | * header: Item | 104 | * header: Item | ||
105 | * an optional item which will be used as the sheet's header, | 105 | * an optional item which will be used as the sheet's header, | ||
106 | * always kept on screen | 106 | * always kept on screen | ||
107 | * @since 5.43 | 107 | * @since 5.43 | ||
108 | */ | 108 | */ | ||
ngraham: missing whitespace around the times sign | |||||
109 | property Item header | 109 | property Item header | ||
110 | 110 | | |||
111 | /** | 111 | /** | ||
112 | * header: Item | 112 | * header: Item | ||
113 | * an optional item which will be used as the sheet's footer, | 113 | * an optional item which will be used as the sheet's footer, | ||
114 | * always kept on screen | 114 | * always kept on screen | ||
115 | * @since 5.43 | 115 | * @since 5.43 | ||
116 | */ | 116 | */ | ||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 228 | onHeightChanged: { | |||
258 | var pos = focusItem.mapToItem(flickableContents, 0, cursorY - Units.gridUnit*3); | 258 | var pos = focusItem.mapToItem(flickableContents, 0, cursorY - Units.gridUnit*3); | ||
259 | //focused item already visible? add some margin for the space of the action buttons | 259 | //focused item already visible? add some margin for the space of the action buttons | ||
260 | if (pos.y >= scrollView.flickableItem.contentY && pos.y <= scrollView.flickableItem.contentY + scrollView.flickableItem.height - Units.gridUnit * 8) { | 260 | if (pos.y >= scrollView.flickableItem.contentY && pos.y <= scrollView.flickableItem.contentY + scrollView.flickableItem.height - Units.gridUnit * 8) { | ||
261 | return; | 261 | return; | ||
262 | } | 262 | } | ||
263 | scrollView.flickableItem.contentY = pos.y; | 263 | scrollView.flickableItem.contentY = pos.y; | ||
264 | } | 264 | } | ||
265 | 265 | | |||
266 | QtObject { | ||||
267 | id: privateObject | ||||
268 | | ||||
269 | readonly property var bottomMargin: { | ||||
270 | if (contentItem.implicitHeight >= (3/4)*outerFlickable.height) { | ||||
271 | return 0 | ||||
272 | } | ||||
273 | return Units.gridUnit*2 | ||||
274 | } | ||||
275 | } | ||||
276 | | ||||
266 | ParallelAnimation { | 277 | ParallelAnimation { | ||
267 | id: openAnimation | 278 | id: openAnimation | ||
268 | property int margins: Units.gridUnit * 5 | 279 | property int margins: Units.gridUnit * 5 | ||
269 | NumberAnimation { | 280 | NumberAnimation { | ||
270 | target: outerFlickable | 281 | target: outerFlickable | ||
271 | properties: "contentY" | 282 | properties: "contentY" | ||
272 | from: -outerFlickable.height | 283 | from: -outerFlickable.height | ||
273 | to: Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) | 284 | to: Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height)+privateObject.bottomMargin | ||
ngraham: missing whitespace around the plus sign | |||||
274 | duration: Units.longDuration | 285 | duration: Units.longDuration | ||
275 | easing.type: Easing.OutQuad | 286 | easing.type: Easing.OutQuad | ||
276 | } | 287 | } | ||
277 | OpacityAnimator { | 288 | OpacityAnimator { | ||
278 | target: mainItem | 289 | target: mainItem | ||
279 | from: 0 | 290 | from: 0 | ||
280 | to: 1 | 291 | to: 1 | ||
281 | duration: Units.longDuration | 292 | duration: Units.longDuration | ||
282 | easing.type: Easing.InQuad | 293 | easing.type: Easing.InQuad | ||
283 | } | 294 | } | ||
284 | } | 295 | } | ||
285 | 296 | | |||
286 | NumberAnimation { | 297 | NumberAnimation { | ||
287 | id: resetAnimation | 298 | id: resetAnimation | ||
288 | target: outerFlickable | 299 | target: outerFlickable | ||
289 | properties: "contentY" | 300 | properties: "contentY" | ||
290 | from: outerFlickable.contentY | 301 | from: outerFlickable.contentY | ||
291 | to: outerFlickable.visibleArea.yPosition < (1 - outerFlickable.visibleArea.heightRatio)/2 || scrollView.flickableItem.contentHeight < outerFlickable.height | 302 | to: (outerFlickable.visibleArea.yPosition < (1 - outerFlickable.visibleArea.heightRatio)/2 || scrollView.flickableItem.contentHeight < outerFlickable.height | ||
292 | ? Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) | 303 | ? Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) | ||
293 | : outerFlickable.contentHeight - outerFlickable.height + outerFlickable.topEmptyArea + headerItem.height + footerItem.height | 304 | : outerFlickable.contentHeight - outerFlickable.height + outerFlickable.topEmptyArea + headerItem.height + footerItem.height)+privateObject.bottomMargin | ||
ngraham: ditto | |||||
294 | duration: Units.longDuration | 305 | duration: Units.longDuration | ||
295 | easing.type: Easing.OutQuad | 306 | easing.type: Easing.OutQuad | ||
296 | } | 307 | } | ||
297 | 308 | | |||
298 | SequentialAnimation { | 309 | SequentialAnimation { | ||
299 | id: closeAnimation | 310 | id: closeAnimation | ||
300 | ParallelAnimation { | 311 | ParallelAnimation { | ||
301 | NumberAnimation { | 312 | NumberAnimation { | ||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |
missing whitespace around the times sign