generialze window search

This commit is contained in:
druiz17 2017-10-11 16:04:35 -07:00
parent 8f3fa08b1e
commit 42cab19ab2
3 changed files with 15 additions and 11 deletions

View file

@ -17,6 +17,7 @@ import "./hifi/audio" as HifiAudio
Hifi.AvatarInputs {
id: root;
objectName: "AvatarInputs"
property int modality: Qt.NonModal
width: audio.width;
height: audio.height;
x: 10; y: 5;

View file

@ -8,7 +8,9 @@ Item {
anchors.leftMargin: 300
objectName: "StatsItem"
property var statsObject: root
property int modality: Qt.NonModal
implicitHeight: row.height
implicitWidth: row.width
Component.onCompleted: {
stats.parentChanged.connect(fill);
@ -19,8 +21,9 @@ Item {
}
function fill() {
// Explicitly fill in order to avoid warnings at shutdown
anchors.fill = parent;
// This will cause a warning at shutdown, need to find another way to remove
// the warning other than filling the anchors to the parent
anchors.horizontalCenter = parent.horizontalCenter
}
Hifi.Stats {

View file

@ -301,17 +301,17 @@ FocusScope {
function isPointOnWindow(point) {
for (var i = 0; i < desktop.visibleChildren.length; i++) {
var child = desktop.visibleChildren[i];
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;
if (child.hasOwnProperty("frame")) {
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)) {
if (child.contains(mappedPoint)) {
return true;
}
}