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 {
id: root;
objectName: "AvatarInputs"
property int modality: Qt.NonModal
width: audio.width;
height: audio.height;
x: 10; y: 5;

View file

@ -8,6 +8,9 @@ Item {
anchors.leftMargin: 300
objectName: "StatsItem"
property int modality: Qt.NonModal
implicitHeight: row.height
implicitWidth: row.width
Component.onCompleted: {
stats.parentChanged.connect(fill);
@ -18,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,15 +301,19 @@ 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);
if (child.hasOwnProperty("modality")) {
var mappedPoint = mapToItem(child, point.x, point.y);
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)) {
if (outLine.contains(framePoint)) {
return true;
}
}
if (child.contains(mappedPoint)) {
return true;
}
}
}
return false;

View file

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