Merge branch 'master' into feature/openvr-linux

This commit is contained in:
David Rowe 2020-06-25 07:39:38 +12:00
commit 901b3f5234
4 changed files with 63 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -3,10 +3,10 @@
// //
// Created by David Rowe on 3 Jun 2015 // Created by David Rowe on 3 Jun 2015
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
//
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import Hifi 1.0 import Hifi 1.0
import QtQuick 2.4 import QtQuick 2.4

View file

@ -3,6 +3,7 @@
// //
// Created by Clement on 7/18/16 // Created by Clement on 7/18/16
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
// //
// Distributed under the Apache License, Version 2.0. // Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -486,6 +487,7 @@ Item {
} }
} }
} }
Item { Item {
id: signUpContainer id: signUpContainer
width: loginContainer.width width: loginContainer.width
@ -494,7 +496,7 @@ Item {
anchors { anchors {
left: loginContainer.left left: loginContainer.left
top: loginContainer.bottom top: loginContainer.bottom
topMargin: 0.15 * parent.height topMargin: 0.05 * parent.height
} }
TextMetrics { TextMetrics {
id: signUpTextMetrics id: signUpTextMetrics
@ -542,37 +544,54 @@ Item {
"errorString": "" }); "errorString": "" });
} }
} }
}
TextMetrics { Text {
id: dismissButtonTextMetrics id: signUpTextSecond
font: loginErrorMessage.font text: qsTr("or")
text: dismissButton.text anchors {
} left: signUpShortcutText.right
HifiControlsUit.Button { leftMargin: hifi.dimensions.contentSpacing.x
id: dismissButton }
width: dismissButtonTextMetrics.width lineHeight: 1
height: d.minHeightButton color: "white"
anchors { font.family: linkAccountBody.fontFamily
bottom: parent.bottom font.pixelSize: linkAccountBody.textFieldFontSize
right: parent.right font.bold: linkAccountBody.fontBold
margins: 3 * hifi.dimensions.contentSpacing.y verticalAlignment: Text.AlignVCenter
} horizontalAlignment: Text.AlignHCenter
color: hifi.buttons.noneBorderlessWhite visible: loginDialog.getLoginDialogPoppedUp() && !linkAccountBody.linkSteam && !linkAccountBody.linkOculus;
text: qsTr("No thanks, take me in-world! >") }
fontCapitalization: Font.MixedCase
fontFamily: linkAccountBody.fontFamily TextMetrics {
fontSize: linkAccountBody.fontSize id: dismissButtonTextMetrics
fontBold: linkAccountBody.fontBold font: loginErrorMessage.font
visible: loginDialog.getLoginDialogPoppedUp() && !linkAccountBody.linkSteam && !linkAccountBody.linkOculus; text: dismissButton.text
onClicked: { }
if (linkAccountBody.loginDialogPoppedUp) { HifiControlsUit.Button {
var data = { id: dismissButton
"action": "user dismissed login screen" width: loginButton.width
}; height: d.minHeightButton
UserActivityLogger.logAction("encourageLoginDialog", data); anchors {
loginDialog.dismissLoginDialog(); top: signUpText.bottom
topMargin: hifi.dimensions.contentSpacing.y
left: loginButton.left
}
text: qsTr("Use without account, log in anonymously")
fontCapitalization: Font.MixedCase
fontFamily: linkAccountBody.fontFamily
fontSize: linkAccountBody.fontSize
fontBold: linkAccountBody.fontBold
visible: loginDialog.getLoginDialogPoppedUp() && !linkAccountBody.linkSteam && !linkAccountBody.linkOculus;
onClicked: {
if (linkAccountBody.loginDialogPoppedUp) {
var data = {
"action": "user dismissed login screen"
};
UserActivityLogger.logAction("encourageLoginDialog", data);
loginDialog.dismissLoginDialog();
}
root.tryDestroy();
} }
root.tryDestroy();
} }
} }
} }

View file

@ -603,8 +603,8 @@ var toolBar = (function () {
Script.setTimeout(dimensionsCheckFunction, DIMENSIONS_CHECK_INTERVAL); Script.setTimeout(dimensionsCheckFunction, DIMENSIONS_CHECK_INTERVAL);
} }
// Make sure the model entity is loaded before we try to figure out // Make sure the model entity is loaded before we try to figure out
// its dimensions. // its dimensions. We need to give ample time to load the entity.
var MAX_LOADED_CHECKS = 10; var MAX_LOADED_CHECKS = 100; // 100 * 100ms = 10 seconds.
var LOADED_CHECK_INTERVAL = 100; var LOADED_CHECK_INTERVAL = 100;
var isLoadedCheckCount = 0; var isLoadedCheckCount = 0;
var entityIsLoadedCheck = function() { var entityIsLoadedCheck = function() {
@ -612,11 +612,19 @@ var toolBar = (function () {
if (isLoadedCheckCount === MAX_LOADED_CHECKS || Entities.isLoaded(entityID)) { if (isLoadedCheckCount === MAX_LOADED_CHECKS || Entities.isLoaded(entityID)) {
var naturalDimensions = Entities.getEntityProperties(entityID, "naturalDimensions").naturalDimensions; var naturalDimensions = Entities.getEntityProperties(entityID, "naturalDimensions").naturalDimensions;
if (isLoadedCheckCount === MAX_LOADED_CHECKS) {
console.log("Model entity failed to load in time: " + (MAX_LOADED_CHECKS * LOADED_CHECK_INTERVAL) + " ... setting dimensions to: " + JSON.stringify(naturalDimensions))
}
Entities.editEntity(entityID, { Entities.editEntity(entityID, {
visible: true, visible: true,
dimensions: naturalDimensions dimensions: naturalDimensions
}) })
dimensionsCheckCallback(); dimensionsCheckCallback();
// We want to update the selection manager again since the script has moved on without us.
selectionManager.clearSelections(this);
entityListTool.sendUpdate();
selectionManager.setSelections([entityID], this);
return; return;
} }
Script.setTimeout(entityIsLoadedCheck, LOADED_CHECK_INTERVAL); Script.setTimeout(entityIsLoadedCheck, LOADED_CHECK_INTERVAL);