Merge branch 'master' of https://github.com/highfidelity/hifi into menuGroups

This commit is contained in:
Brad Hefta-Gaub 2016-01-11 09:09:37 -08:00
commit 3e05d95478
3 changed files with 21 additions and 3 deletions

View file

@ -13,6 +13,12 @@
SpatiallyNestableWeakPointer AssignmentParentFinder::find(QUuid parentID, bool& success) const { SpatiallyNestableWeakPointer AssignmentParentFinder::find(QUuid parentID, bool& success) const {
SpatiallyNestableWeakPointer parent; SpatiallyNestableWeakPointer parent;
if (parentID.isNull()) {
success = true;
return parent;
}
// search entities // search entities
parent = _tree->findEntityByEntityItemID(parentID); parent = _tree->findEntityByEntityItemID(parentID);
if (parent.expired()) { if (parent.expired()) {

View file

@ -1,4 +1,4 @@
<!-- Copyright 2015 High Fidelity, Inc. --> <!-- Copyright 2015 High Fidelity, Inc. -->
<html> <html>
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
@ -14,7 +14,7 @@
body { body {
background: white; background: white;
width: 839px; width: 100%;
overflow-x: hidden; overflow-x: hidden;
} }
@ -181,7 +181,7 @@
function overrideBodyWidth() { function overrideBodyWidth() {
document.body.style.width = "100%"; document.body.style.width = "100%";
<!-- Force reset layout after body resized--> <!-- Force reset layout after body resized-->
container.style.width = "0"; <!-- container.style.width = "0"; -->
} }
//]]></script> //]]></script>

View file

@ -51,6 +51,16 @@ Hifi.VrMenu {
VrMenuView { VrMenuView {
property int menuDepth: root.models.length - 1 property int menuDepth: root.models.length - 1
model: root.models[menuDepth] model: root.models[menuDepth]
function fit(position, size, maxposition) {
var padding = 8;
if (position < padding) {
position = padding;
} else if (position + size + padding > maxposition) {
position = maxposition - (size + padding);
}
return position;
}
Component.onCompleted: { Component.onCompleted: {
if (menuDepth === 0) { if (menuDepth === 0) {
@ -61,6 +71,8 @@ Hifi.VrMenu {
x = lastColumn.x + 64; x = lastColumn.x + 64;
y = lastMousePosition.y - height / 2; y = lastMousePosition.y - height / 2;
} }
x = fit(x, width, parent.width);
y = fit(y, height, parent.height);
} }
onSelected: { onSelected: {