Merge pull request #11573 from druiz17/bug-hud-module

hud module intersects with dev stats window
This commit is contained in:
Brad Hefta-Gaub 2017-10-13 11:48:06 -07:00 committed by GitHub
commit 60030c08fa
4 changed files with 20 additions and 10 deletions

View file

@ -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;

View file

@ -8,6 +8,9 @@ Item {
anchors.leftMargin: 300 anchors.leftMargin: 300
objectName: "StatsItem" objectName: "StatsItem"
property int modality: Qt.NonModal
implicitHeight: row.height
implicitWidth: row.width
Component.onCompleted: { Component.onCompleted: {
stats.parentChanged.connect(fill); stats.parentChanged.connect(fill);
@ -18,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 {

View file

@ -301,15 +301,19 @@ 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];
if (child.visible) { if (child.hasOwnProperty("modality")) {
if (child.hasOwnProperty("modality")) { var mappedPoint = mapToItem(child, point.x, point.y);
var mappedPoint = child.mapFromGlobal(point.x, point.y); if (child.hasOwnProperty("frame")) {
var outLine = child.frame.children[2]; var outLine = child.frame.children[2];
var framePoint = outLine.mapFromGlobal(point.x, point.y); var framePoint = outLine.mapFromGlobal(point.x, point.y);
if (child.contains(mappedPoint) || outLine.contains(framePoint)) { if (outLine.contains(framePoint)) {
return true; return true;
} }
} }
if (child.contains(mappedPoint)) {
return true;
}
} }
} }
return false; return false;

View file

@ -106,14 +106,15 @@ extern std::atomic<size_t> DECIMATED_TEXTURE_COUNT;
extern std::atomic<size_t> RECTIFIED_TEXTURE_COUNT; extern std::atomic<size_t> RECTIFIED_TEXTURE_COUNT;
void Stats::updateStats(bool force) { void Stats::updateStats(bool force) {
QQuickItem* parent = parentItem();
if (!force) { if (!force) {
if (!Menu::getInstance()->isOptionChecked(MenuOption::Stats)) { if (!Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
if (isVisible()) { if (parent->isVisible()) {
setVisible(false); parent->setVisible(false);
} }
return; return;
} else if (!isVisible()) { } else if (!parent->isVisible()) {
setVisible(true); parent->setVisible(true);
} }
} }