Debian Codegraph @

tests/unit/inversemousearea13/InverseMouseAreaOnTopNoAccept.qml

raw
1 /*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 import QtQuick 2.0
18 import Lomiri.Components 1.1
19
20 Rectangle {
21 id: page
22 width: 300
23 height: 300
24 color: "lightgray"
25
26 objectName: "ROOT"
27
28 Rectangle {
29 id: label
30 objectName: "RECT1"
31 anchors.horizontalCenter: parent.horizontalCenter
32 anchors.top: parent.top
33 height: 40
34 width: parent.width
35 color: Qt.rgba(1, 0, 0, 0.4)
36
37 MouseArea {
38 objectName: "MA1"
39 anchors.fill: parent
40 z: 1
41 }
42 }
43
44 Rectangle {
45 anchors.top: label.bottom
46 anchors.topMargin: 20
47 anchors.horizontalCenter: parent.horizontalCenter
48 height: 60
49 width: parent.width
50 color: Qt.rgba(0, 0, 1, 0.4)
51 objectName: "RECT2"
52
53 Button {
54 id: button
55 objectName: "button"
56 x: 20
57 y: 10
58 text: "I'm a button, I do nothing."
59 }
60
61 MouseArea {
62 objectName: "MA2"
63 anchors.fill: parent
64 }
65
66 InverseMouseArea {
67 objectName: "IMA"
68 anchors.fill: button
69 onPressed: mouse.accepted = false
70 }
71 }
72 }