mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 03:40:20 +02:00
generialze window search
This commit is contained in:
parent
8f3fa08b1e
commit
42cab19ab2
3 changed files with 15 additions and 11 deletions
|
@ -17,6 +17,7 @@ import "./hifi/audio" as HifiAudio
|
||||||
Hifi.AvatarInputs {
|
Hifi.AvatarInputs {
|
||||||
id: root;
|
id: root;
|
||||||
objectName: "AvatarInputs"
|
objectName: "AvatarInputs"
|
||||||
|
property int modality: Qt.NonModal
|
||||||
width: audio.width;
|
width: audio.width;
|
||||||
height: audio.height;
|
height: audio.height;
|
||||||
x: 10; y: 5;
|
x: 10; y: 5;
|
||||||
|
|
|
@ -8,7 +8,9 @@ Item {
|
||||||
|
|
||||||
anchors.leftMargin: 300
|
anchors.leftMargin: 300
|
||||||
objectName: "StatsItem"
|
objectName: "StatsItem"
|
||||||
property var statsObject: root
|
property int modality: Qt.NonModal
|
||||||
|
implicitHeight: row.height
|
||||||
|
implicitWidth: row.width
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
stats.parentChanged.connect(fill);
|
stats.parentChanged.connect(fill);
|
||||||
|
@ -19,8 +21,9 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fill() {
|
function fill() {
|
||||||
// Explicitly fill in order to avoid warnings at shutdown
|
// This will cause a warning at shutdown, need to find another way to remove
|
||||||
anchors.fill = parent;
|
// the warning other than filling the anchors to the parent
|
||||||
|
anchors.horizontalCenter = parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Hifi.Stats {
|
Hifi.Stats {
|
||||||
|
|
|
@ -301,17 +301,17 @@ FocusScope {
|
||||||
function isPointOnWindow(point) {
|
function isPointOnWindow(point) {
|
||||||
for (var i = 0; i < desktop.visibleChildren.length; i++) {
|
for (var i = 0; i < desktop.visibleChildren.length; i++) {
|
||||||
var child = desktop.visibleChildren[i];
|
var child = desktop.visibleChildren[i];
|
||||||
var childName = child.objectName;
|
|
||||||
if (child.hasOwnProperty("modality")) {
|
if (child.hasOwnProperty("modality")) {
|
||||||
var mappedPoint = child.mapFromGlobal(point.x, point.y);
|
var mappedPoint = child.mapFromGlobal(point.x, point.y);
|
||||||
var outLine = child.frame.children[2];
|
if (child.hasOwnProperty("frame")) {
|
||||||
var framePoint = outLine.mapFromGlobal(point.x, point.y);
|
var outLine = child.frame.children[2];
|
||||||
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
|
var framePoint = outLine.mapFromGlobal(point.x, point.y);
|
||||||
return true;
|
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (childName === "StatsItem") {
|
|
||||||
var mappedPoint = child.statsObject.mapFromGlobal(point.x, point.y);
|
if (child.contains(mappedPoint)) {
|
||||||
if (child.statsObject.contains(mappedPoint)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue