on xenial help sign in
Input is always filtered on notifications
commit0014ef1fee58d69c80fa38bc263cb2b4558ac16e authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 3 Jan 2014, 10:29 (13 years ago) parente5ca57b
2 files changed+9−12
qml/Notifications/Notification.qml+5−2 tests/qmltests/Notifications/tst_Notifications.qml+4−10
qml/Notifications/Notification.qml+5−2
@@ -106,8 +106,11 @@ Item {
106106
107107 anchors.fill: contentColumn
108108 objectName: "interactiveArea"
109− enabled: notification.type == Notification.Interactive
110− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
109+ onClicked: {
110+ if (notification.type == Notification.Interactive) {
111+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
112+ }
113+ }
111114 }
112115
113116 Column {
tests/qmltests/Notifications/tst_Notifications.qml+4−10
@@ -225,7 +225,6 @@ Row {
225225 { id: "nada_id", label: "Nada"}],
226226 summaryVisible: true,
227227 bodyVisible: true,
228− interactiveAreaEnabled: false,
229228 iconVisible: true,
230229 shapedIcon: true,
231230 nonShapedIcon: false,
@@ -244,7 +243,6 @@ Row {
244243 actions: [],
245244 summaryVisible: true,
246245 bodyVisible: false,
247− interactiveAreaEnabled: false,
248246 iconVisible: false,
249247 shapedIcon: false,
250248 nonShapedIcon: false,
@@ -282,7 +280,6 @@ Row {
282280 actions: [{ id: "reply_id", label: "Dummy"}],
283281 summaryVisible: true,
284282 bodyVisible: true,
285− interactiveAreaEnabled: true,
286283 iconVisible: true,
287284 shapedIcon: true,
288285 nonShapedIcon: false,
@@ -302,7 +299,6 @@ Row {
302299 { id: "reject_id", label: "Reject"}],
303300 summaryVisible: true,
304301 bodyVisible: true,
305− interactiveAreaEnabled: false,
306302 iconVisible: true,
307303 shapedIcon: true,
308304 nonShapedIcon: false,
@@ -321,7 +317,6 @@ Row {
321317 actions: [],
322318 summaryVisible: true,
323319 bodyVisible: true,
324− interactiveAreaEnabled: false,
325320 iconVisible: true,
326321 shapedIcon: true,
327322 nonShapedIcon: false,
@@ -341,7 +336,6 @@ Row {
341336 actions: [],
342337 summaryVisible: true,
343338 bodyVisible: true,
344− interactiveAreaEnabled: false,
345339 iconVisible: true,
346340 shapedIcon: false,
347341 nonShapedIcon: true,
@@ -395,14 +389,14 @@ Row {
395389 compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
396390 compare(shapedIcon.visible, data.shapedIcon, "shaped-icon visibility is incorrect")
397391 compare(nonShapedIcon.visible, data.nonShapedIcon, "non-shaped-icon visibility is incorrect")
398− compare(interactiveArea.enabled, data.interactiveAreaEnabled, "check for interactive area")
399392
400− if(data.interactiveAreaEnabled) {
401− mouseClick(notification, notification.width / 2, notification.height / 2)
393+ // test input does not fall through
394+ mouseClick(notification, notification.width / 2, notification.height / 2)
395+ if(data.type == Notification.Interactive) {
402396 actionSpy.wait()
403397 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
404− compare(clickThroughSpy.count, 0, "click on interactive notification fell through")
405398 }
399+ compare(clickThroughSpy.count, 0, "click on notification fell through")
406400
407401 compare(secondaryIcon.visible, data.secondaryIconVisible, "secondary-icon visibility is incorrect")
408402 compare(summaryLabel.visible, data.summaryVisible, "summary-text visibility is incorrect")