hud module intersects with stats window

This commit is contained in:
druiz17 2017-10-11 11:41:10 -07:00
parent 160be95081
commit 8f3fa08b1e
2 changed files with 13 additions and 8 deletions

View file

@ -8,6 +8,7 @@ Item {
anchors.leftMargin: 300
objectName: "StatsItem"
property var statsObject: root
Component.onCompleted: {
stats.parentChanged.connect(fill);

View file

@ -301,14 +301,18 @@ FocusScope {
function isPointOnWindow(point) {
for (var i = 0; i < desktop.visibleChildren.length; i++) {
var child = desktop.visibleChildren[i];
if (child.visible) {
if (child.hasOwnProperty("modality")) {
var mappedPoint = child.mapFromGlobal(point.x, point.y);
var outLine = child.frame.children[2];
var framePoint = outLine.mapFromGlobal(point.x, point.y);
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
return true;
}
var childName = child.objectName;
if (child.hasOwnProperty("modality")) {
var mappedPoint = child.mapFromGlobal(point.x, point.y);
var outLine = child.frame.children[2];
var framePoint = outLine.mapFromGlobal(point.x, point.y);
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
return true;
}
} else if (childName === "StatsItem") {
var mappedPoint = child.statsObject.mapFromGlobal(point.x, point.y);
if (child.statsObject.contains(mappedPoint)) {
return true;
}
}
}