on xenial help sign in
Make all but confirmation notifications and expanded snap-decisions draggable/swipe-dismissable. Updated qmltest accordingly.
commit5aa8f18d47db939ea62a2d0e6a997c496a53cc16 authorMirco Müller <mirco.mueller@ubuntu.com> dateMon 10 Nov 2014, 18:06 (12 years ago) parentd78335d
2 files changed+9−7
qml/Notifications/Notification.qml+1−1 tests/qmltests/Notifications/tst_Notifications.qml+8−6
qml/Notifications/Notification.qml+1−1
@@ -38,9 +38,9 @@ Item {
3838 property var notification
3939 property color color
4040 property bool fullscreen: false
41− readonly property bool draggable: state == "contracted" || notification.type !== Notification.Confirmation
4241 property int maxHeight
4342 property int margins
43+ readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") || type === Notification.Interactive || type === Notification.Ephemeral
4444 readonly property bool darkOnBright: panel.indicators.shown || type === Notification.SnapDecision
4545 readonly property color red: "#fc4949"
4646 readonly property color green: "#3fb24f"
tests/qmltests/Notifications/tst_Notifications.qml+8−6
@@ -668,14 +668,16 @@ Item {
668668 }
669669
670670 // swipe-to-dismiss check
671+ var before = mockModel.count
672+ var dragStart = notification.width * 0.25;
673+ var dragEnd = notification.width;
674+ var dragY = notification.height / 2;
675+ touchFlick(notification, dragStart, dragY, dragEnd, dragY)
676+ waitForRendering(notification)
671677 if (data.type !== Notification.SnapDecision && notification.state !== "expanded") {
672− var before = mockModel.count
673− var dragStart = notification.width * 0.25;
674− var dragEnd = notification.width;
675− var dragY = notification.height / 2;
676− touchFlick(notification, dragStart, dragY, dragEnd, dragY)
677− waitForRendering(notification)
678678 tryCompare(mockModel, "count", before - 1)
679+ } else {
680+ tryCompare(mockModel, "count", before)
679681 }
680682 }
681683 }