@@ -274,53 +274,71 @@ Window {
274274 anchors .bottomMargin : window .isWindows ? 1 : 0
275275 clip: true
276276 }
277- MouseArea {
278- enabled: window .isWindows && window .canResize
279- anchors .fill : parent
280- hoverEnabled: true
281- cursorShape: {
282- const pos = Qt .point (mouseX, mouseY);
283- const offset = resizeHandleSize;
284- if ((pos .x < offset) && (pos .y >= (height - offset))) {
285- return Qt .SizeBDiagCursor ;
286- }
287- if ((pos .x < offset) && (pos .y < offset)) {
288- return Qt .SizeFDiagCursor ;
289- }
290- if ((pos .x >= (width - offset)) && (pos .y >= (height - offset))) {
291- return Qt .SizeFDiagCursor ;
292- }
293- if ((pos .x < offset) || ((pos .x >= (width - offset)) && (pos .y > titleBarHeight))) {
294- return Qt .SizeHorCursor ;
295- }
296- if ((pos .y > (height - offset)) || ((pos .y < offset) && (pos .x < (width - 120 )))) {
297- return Qt .SizeVerCursor ;
277+
278+ Loader {
279+ active: window .isWindows && window .canResize
280+ sourceComponent: Component {
281+ MouseArea {
282+ enabled: window .isWindows && window .canResize
283+ anchors .fill : parent
284+ hoverEnabled: window .isWindows && window .canResize
285+ cursorShape: {
286+ console .log (" MouseArea::cursorShape" )
287+ console .log (" window.isWindows && window.canResize: " + (window .isWindows && window .canResize ))
288+ const pos = Qt .point (mouseX, mouseY);
289+ const offset = resizeHandleSize;
290+ if ((pos .x < offset) && (pos .y >= (height - offset))) {
291+ return Qt .SizeBDiagCursor ;
292+ }
293+ if ((pos .x < offset) && (pos .y < offset)) {
294+ return Qt .SizeFDiagCursor ;
295+ }
296+ if ((pos .x >= (width - offset)) && (pos .y >= (height - offset))) {
297+ return Qt .SizeFDiagCursor ;
298+ }
299+ if ((pos .x < offset) || ((pos .x >= (width - offset)) && (pos .y > titleBarHeight))) {
300+ return Qt .SizeHorCursor ;
301+ }
302+ if ((pos .y > (height - offset)) || ((pos .y < offset) && (pos .x < (width - 120 )))) {
303+ return Qt .SizeVerCursor ;
304+ }
305+ }
306+ onClicked: {
307+ console .log (" width: " + width + " height: " + height)
308+ }
309+ acceptedButtons: Qt .NoButton
298310 }
299311 }
300- acceptedButtons: Qt .NoButton
301312 }
302- DragHandler {
303- id: resizeHandler
304- enabled: window .isWindows && window .canResize
305- target: null
306- grabPermissions: TapHandler .TakeOverForbidden
307- onActiveChanged: if (active) {
308- const pos = resizeHandler .centroid .position ;
309- const offset = resizeHandleSize + 10 ;
310- let edges = 0 ;
311- if (pos .x < offset) {
312- edges |= Qt .LeftEdge ;
313- }
314- if (pos .x >= (width - offset)) {
315- edges += Qt .RightEdge ;
316- }
317- if (pos .y < offset) {
318- edges |= Qt .TopEdge ;
319- }
320- if (pos .y >= (height - offset)) {
321- edges |= Qt .BottomEdge ;
313+ Loader {
314+ active: window .isWindows && window .canResize
315+ sourceComponent: Component {
316+ DragHandler {
317+ id: resizeHandler
318+ enabled: window .isWindows && window .canResize
319+ target: null
320+ grabPermissions: TapHandler .TakeOverForbidden
321+ onActiveChanged: {
322+ if (active) {
323+ const pos = resizeHandler .centroid .position ;
324+ const offset = resizeHandleSize + 10 ;
325+ let edges = 0 ;
326+ if (pos .x < offset) {
327+ edges |= Qt .LeftEdge ;
328+ }
329+ if (pos .x >= (width - offset)) {
330+ edges += Qt .RightEdge ;
331+ }
332+ if (pos .y < offset) {
333+ edges |= Qt .TopEdge ;
334+ }
335+ if (pos .y >= (height - offset)) {
336+ edges |= Qt .BottomEdge ;
337+ }
338+ window .startSystemResize (edges);
339+ }
340+ }
322341 }
323- window .startSystemResize (edges);
324342 }
325343 }
326344
0 commit comments