on xenial help sign in
make the info label not intercept the first press
commitba3fb28109a9cded00164821e14e4f9e38e0367c authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 21 Jan 2016, 16:03 (11 years ago) parentfa55e6f
3 files changed+13−8
qml/Components/VirtualTouchPad.qml+1 qml/DisabledScreenNotice.qml+8−5 tests/qmltests/tst_DisabledScreenNotice.qml+4−3
qml/Components/VirtualTouchPad.qml+1
@@ -24,6 +24,7 @@ Item {
2424 Component.onDestruction: removeMouse();
2525 }
2626
27+ readonly property bool pressed: point1.pressed || point2.pressed
2728
2829 MultiPointTouchArea {
2930 objectName: "touchPadArea"
qml/DisabledScreenNotice.qml+8−5
@@ -55,6 +55,12 @@ Item {
5555
5656 VirtualTouchPad {
5757 anchors.fill: parent
58+
59+ onPressedChanged: {
60+ if (pressed && infoNoteDisplayed) {
61+ infoNoteDisplayed = false;
62+ }
63+ }
5864 }
5965
6066 Image {
@@ -62,18 +68,15 @@ Item {
6268 source: wallpaperResolver.background
6369 }
6470
65− MouseArea {
66− objectName: "infoNoticeMouseArea"
71+ Item {
72+ objectName: "infoNoticeArea"
6773 anchors.fill: parent
6874 opacity: infoNoteDisplayed ? 1 : 0
6975 visible: opacity > 0
70− enabled: visible
7176 Behavior on opacity {
7277 UbuntuNumberAnimation { }
7378 }
7479
75− onClicked: root.infoNoteDisplayed = false;
76−
7780 Rectangle {
7881 anchors.fill: parent
7982 color: "black"
tests/qmltests/tst_DisabledScreenNotice.qml+4−3
@@ -35,10 +35,11 @@ Item {
3535 when: windowShown
3636
3737 function test_mouseAreaHidesOnFirstTap() {
38− var mouseArea = findChild(touchScreenPad, "infoNoticeMouseArea")
39− compare(mouseArea.enabled, true)
38+ var noticeArea = findChild(touchScreenPad, "infoNoticeArea")
39+ print("noticeArea", noticeArea.visible)
40+ compare(noticeArea.visible, true)
4041 tap(root)
41− tryCompare(mouseArea, "enabled", false)
42+ tryCompare(noticeArea, "visible", false)
4243 }
4344 }
4445}