MauiKit Controls

WindowResizeHandlers.qml
1/*
2 * Copyright 2018 Camilo Higuita <milo.h@aol.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick
21
22import QtQuick.Window
23import QtQuick.Controls
24
25Item
26{
27 Loader
28 {
29 asynchronous: true
30 visible: active
31 height: parent.height
32 width: 6
33 anchors.right: parent.right
34
35 sourceComponent: Item
36 {
37 MouseArea
38 {
39 anchors.fill: parent
40 cursorShape: Qt.SizeHorCursor
41 acceptedButtons: Qt.NoButton // don't handle actual events
42 }
43
44 DragHandler
45 {
46 grabPermissions: TapHandler.TakeOverForbidden
47 target: null
48 onActiveChanged:
49 {
50 if (active)
51 {
52 root.startSystemResize(Qt.RightEdge)
53 }
54 }
55 }
56 }
57 }
58
59 Loader
60 {
61 asynchronous: true
62 visible: active
63 height: parent.height
64 width: 6
65 anchors.left: parent.left
66
67 sourceComponent: Item
68 {
69 MouseArea
70 {
71 anchors.fill: parent
72 cursorShape: Qt.SizeHorCursor
73 acceptedButtons: Qt.NoButton // don't handle actual events
74 }
75
76 DragHandler
77 {
78 grabPermissions: TapHandler.TakeOverForbidden
79 target: null
80 onActiveChanged:
81 {
82 if (active)
83 {
84 root.startSystemResize(Qt.LeftEdge)
85 }
86 }
87 }
88 }
89 }
90
91 Loader
92 {
93 asynchronous: true
94 visible: active
95 height: 6
96 width: parent.width
97 anchors.bottom: parent.bottom
98
99 sourceComponent: Item
100 {
101 MouseArea
102 {
103 anchors.fill: parent
104 cursorShape: Qt.SizeVerCursor
105 acceptedButtons: Qt.NoButton // don't handle actual events
106 }
107
108 DragHandler
109 {
110 grabPermissions: TapHandler.TakeOverForbidden
111 target: null
112 onActiveChanged:
113 {
114 if (active)
115 {
116 root.startSystemResize(Qt.BottomEdge)
117 }
118 }
119 }
120 }
121 }
122
123
124 Loader
125 {
126 asynchronous: true
127 visible: active
128 height: 16
129 width: height
130 anchors.bottom: parent.bottom
131 anchors.left: parent.left
132
133 sourceComponent: Item
134 {
135 MouseArea
136 {
137 anchors.fill: parent
138 cursorShape: Qt.SizeBDiagCursor
139 acceptedButtons: Qt.NoButton // don't handle actual events
140 }
141
142 DragHandler
143 {
144 grabPermissions: TapHandler.TakeOverForbidden
145 target: null
146 onActiveChanged:
147 {
148 if (active)
149 {
150 root.startSystemResize(Qt.LeftEdge | Qt.BottomEdge);
151 }
152 }
153 }
154 }
155 }
156
157 Loader
158 {
159 asynchronous: true
160 visible: active
161 height: 16
162 width: height
163 anchors.bottom: parent.bottom
164 anchors.right: parent.right
165
166 sourceComponent: Item
167 {
168 MouseArea
169 {
170 anchors.fill: parent
171 cursorShape: Qt.SizeFDiagCursor
172 acceptedButtons: Qt.NoButton // don't handle actual events
173 }
174
175 DragHandler
176 {
177 grabPermissions: TapHandler.TakeOverForbidden
178 target: null
179 onActiveChanged:
180 {
181 if (active)
182 {
183 root.startSystemResize(Qt.RightEdge | Qt.BottomEdge)
184 }
185 }
186 }
187 }
188 }
189
190}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.