Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/FullRepresentation.qml
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Line(s) | 373 | addDisplaced: Transition { | |||
---|---|---|---|---|---|
374 | NumberAnimation { properties: "y"; duration: units.longDuration } | 374 | NumberAnimation { properties: "y"; duration: units.longDuration } | ||
375 | } | 375 | } | ||
376 | 376 | | |||
377 | remove: Transition { | 377 | remove: Transition { | ||
378 | id: removeTransition | 378 | id: removeTransition | ||
379 | ParallelAnimation { | 379 | ParallelAnimation { | ||
380 | NumberAnimation { property: "opacity"; to: 0; duration: units.longDuration } | 380 | NumberAnimation { property: "opacity"; to: 0; duration: units.longDuration } | ||
381 | NumberAnimation { | 381 | NumberAnimation { | ||
382 | id: removeXAnimation | ||||
382 | property: "x" | 383 | property: "x" | ||
383 | to: removeTransition.ViewTransition.item.x >= 0 ? list.width : -list.width | 384 | to: list.width | ||
384 | duration: units.longDuration | 385 | duration: units.longDuration | ||
385 | } | 386 | } | ||
386 | } | 387 | } | ||
387 | } | 388 | } | ||
388 | removeDisplaced: Transition { | 389 | removeDisplaced: Transition { | ||
389 | SequentialAnimation { | 390 | SequentialAnimation { | ||
390 | PauseAnimation { duration: units.longDuration } | 391 | PauseAnimation { duration: units.longDuration } | ||
391 | NumberAnimation { properties: "y"; duration: units.longDuration } | 392 | NumberAnimation { properties: "y"; duration: units.longDuration } | ||
392 | } | 393 | } | ||
393 | } | 394 | } | ||
394 | 395 | | |||
395 | // This is so the delegates can detect the change in "isInGroup" and show a separator | 396 | // This is so the delegates can detect the change in "isInGroup" and show a separator | ||
396 | section { | 397 | section { | ||
397 | property: "isInGroup" | 398 | property: "isInGroup" | ||
398 | criteria: ViewSection.FullString | 399 | criteria: ViewSection.FullString | ||
399 | } | 400 | } | ||
400 | 401 | | |||
401 | delegate: DraggableDelegate { | 402 | delegate: DraggableDelegate { | ||
402 | width: list.width | 403 | width: list.width | ||
403 | contentItem: delegateLoader | 404 | contentItem: delegateLoader | ||
404 | 405 | | |||
405 | draggable: !model.isGroup && model.type != NotificationManager.Notifications.JobType | 406 | draggable: !model.isGroup && model.type != NotificationManager.Notifications.JobType | ||
406 | 407 | | |||
407 | onDismissRequested: historyModel.close(historyModel.index(index, 0)); | 408 | onDismissRequested: { | ||
409 | // Setting the animation target explicitly before removing the notification: | ||||
410 | // Using ViewTransition.item.x to get the x position in the animation | ||||
411 | // causes random crash in attached property access (cf. Bug 414066) | ||||
412 | if (x < 0) { | ||||
413 | removeXAnimation.to = -list.width; | ||||
414 | } | ||||
415 | | ||||
416 | historyModel.close(historyModel.index(index, 0)); | ||||
417 | } | ||||
408 | 418 | | |||
409 | Loader { | 419 | Loader { | ||
410 | id: delegateLoader | 420 | id: delegateLoader | ||
411 | width: list.width | 421 | width: list.width | ||
412 | sourceComponent: model.isGroup ? groupDelegate : notificationDelegate | 422 | sourceComponent: model.isGroup ? groupDelegate : notificationDelegate | ||
413 | 423 | | |||
414 | Component { | 424 | Component { | ||
415 | id: groupDelegate | 425 | id: groupDelegate | ||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |