Debian Codegraph @

tests/unit/inversemousearea13/InverseMouseAreaInWindow.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 QtQuick.Window 2.0
19 import Lomiri.Components 1.1
20
21 Item{
22 id: root
23 property string log: ""
24 // onLogChanged: print("LOG", log)
25 width: units.gu(100)
26 height: units.gu(100)
27
28 Window {
29 objectName: "isawindow"
30 width: units.gu(50)
31 height: units.gu(50)
32 visible: true
33
34 Item {
35 id: clickArea
36 objectName: "clickArea"
37 anchors {
38 left: parent.left
39 right: parent.right
40 top: parent.top
41 }
42 height: units.gu(10)
43 Label {
44 anchors.centerIn: parent
45 text: "click me"
46 }
47 }
48
49 Rectangle {
50 id: rect
51 color: "red"
52 anchors {
53 left: parent.left
54 right: parent.right
55 top: clickArea.bottom
56 bottom: parent.bottom
57 }
58 }
59
60 InverseMouseArea {
61 objectName: "ima"
62 id: ima
63 anchors.fill: rect
64 onClicked: {
65 root.log = "IMA"
66 rect.color = "green"
67 }
68 }
69 }
70 }