on xenial help sign in
Make all but confirmation notifications and expanded snap-decisions draggable/swipe-dismissable. Updated qmltest accordingly.
5aa8f18Mirco Müller
qml/Notifications/Notification.qml+1−1
@@ -38,9 +38,9 @@ Item {
38 property var notification
38 property var notification
39 property color color
39 property color color
40 property bool fullscreen: false
40 property bool fullscreen: false
41− readonly property bool draggable: state == "contracted" || notification.type !== Notification.Confirmation
42 property int maxHeight
41 property int maxHeight
43 property int margins
42 property int margins
43+ readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") || type === Notification.Interactive || type === Notification.Ephemeral
44 readonly property bool darkOnBright: panel.indicators.shown || type === Notification.SnapDecision
44 readonly property bool darkOnBright: panel.indicators.shown || type === Notification.SnapDecision
45 readonly property color red: "#fc4949"
45 readonly property color red: "#fc4949"
46 readonly property color green: "#3fb24f"
46 readonly property color green: "#3fb24f"
tests/qmltests/Notifications/tst_Notifications.qml+8−6
@@ -668,14 +668,16 @@ Item {
668 }
668 }
669
669
670 // swipe-to-dismiss check
670 // 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)
671 if (data.type !== Notification.SnapDecision && notification.state !== "expanded") {
677 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)
678 tryCompare(mockModel, "count", before - 1)
678 tryCompare(mockModel, "count", before - 1)
679+ } else {
680+ tryCompare(mockModel, "count", before)
679 }
681 }
680 }
682 }
681 }
683 }