on xenial help sign in
make the info label not intercept the first press
ba3fb28Michael Zanetti
qml/Components/VirtualTouchPad.qml+1
@@ -24,6 +24,7 @@ Item {
24 Component.onDestruction: removeMouse();
24 Component.onDestruction: removeMouse();
25 }
25 }
26
26
27+ readonly property bool pressed: point1.pressed || point2.pressed
27
28
28 MultiPointTouchArea {
29 MultiPointTouchArea {
29 objectName: "touchPadArea"
30 objectName: "touchPadArea"
qml/DisabledScreenNotice.qml+8−5
@@ -55,6 +55,12 @@ Item {
55
55
56 VirtualTouchPad {
56 VirtualTouchPad {
57 anchors.fill: parent
57 anchors.fill: parent
58+
59+ onPressedChanged: {
60+ if (pressed && infoNoteDisplayed) {
61+ infoNoteDisplayed = false;
62+ }
63+ }
58 }
64 }
59
65
60 Image {
66 Image {
@@ -62,18 +68,15 @@ Item {
62 source: wallpaperResolver.background
68 source: wallpaperResolver.background
63 }
69 }
64
70
65− MouseArea {
71+ Item {
66− objectName: "infoNoticeMouseArea"
72+ objectName: "infoNoticeArea"
67 anchors.fill: parent
73 anchors.fill: parent
68 opacity: infoNoteDisplayed ? 1 : 0
74 opacity: infoNoteDisplayed ? 1 : 0
69 visible: opacity > 0
75 visible: opacity > 0
70− enabled: visible
71 Behavior on opacity {
76 Behavior on opacity {
72 UbuntuNumberAnimation { }
77 UbuntuNumberAnimation { }
73 }
78 }
74
79
75− onClicked: root.infoNoteDisplayed = false;
76−
77 Rectangle {
80 Rectangle {
78 anchors.fill: parent
81 anchors.fill: parent
79 color: "black"
82 color: "black"
tests/qmltests/tst_DisabledScreenNotice.qml+4−3
@@ -35,10 +35,11 @@ Item {
35 when: windowShown
35 when: windowShown
36
36
37 function test_mouseAreaHidesOnFirstTap() {
37 function test_mouseAreaHidesOnFirstTap() {
38− var mouseArea = findChild(touchScreenPad, "infoNoticeMouseArea")
38+ var noticeArea = findChild(touchScreenPad, "infoNoticeArea")
39+ print("noticeArea", noticeArea.visible)
39− compare(mouseArea.enabled, true)
40+ compare(noticeArea.visible, true)
40 tap(root)
41 tap(root)
41− tryCompare(mouseArea, "enabled", false)
42+ tryCompare(noticeArea, "visible", false)
42 }
43 }
43 }
44 }
44}
45}