Debian Codegraph @

tests/unit/inversemousearea13/InverseMouseAreaClip.qml

raw
1 /*
2 * Copyright 2014 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 color: "yellow"
22 width: units.gu(70)
23 height: units.gu(70)
24
25 property InverseMouseArea ima: imaItem
26
27 Label {
28 anchors {
29 horizontalCenter: parent.horizontalCenter
30 top: parent.top
31 }
32 text: "Root"
33 }
34
35 Rectangle {
36 color: "green"
37 width: units.gu(50)
38 height: units.gu(50)
39 anchors.centerIn: parent
40 clip: true
41
42 Label {
43 anchors {
44 horizontalCenter: parent.horizontalCenter
45 top: parent.top
46 }
47 text: "Clipper"
48 }
49
50 Rectangle {
51 width: units.gu(30)
52 height: units.gu(30)
53 color: "lightgrey"
54 anchors.centerIn: parent
55
56 Label {
57 anchors {
58 horizontalCenter: parent.horizontalCenter
59 top: parent.top
60 }
61 text: "Inverse mouse area"
62 }
63
64 InverseMouseArea {
65 id: imaItem
66 objectName: "Test_IMA"
67 anchors.fill: parent
68 topmostItem: true
69 clip: false
70 }
71 }
72 }
73 }