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

This commit is contained in:
Nissim Hadar 2018-02-21 12:36:56 -08:00
commit b519ebd6f1
8 changed files with 42 additions and 48 deletions

View file

@ -75,8 +75,6 @@ Item {
// TODO: Fix this unlikely bug // TODO: Fix this unlikely bug
onVisibleChanged: { onVisibleChanged: {
if (visible) { if (visible) {
passphraseField.error = false;
passphraseField.focus = true;
sendSignalToParent({method: 'disableHmdPreview'}); sendSignalToParent({method: 'disableHmdPreview'});
} else { } else {
sendSignalToParent({method: 'maybeEnableHmdPreview'}); sendSignalToParent({method: 'maybeEnableHmdPreview'});
@ -207,6 +205,14 @@ Item {
activeFocusOnPress: true; activeFocusOnPress: true;
activeFocusOnTab: true; activeFocusOnTab: true;
onVisibleChanged: {
if (visible) {
error = false;
focus = true;
forceActiveFocus();
}
}
onFocusChanged: { onFocusChanged: {
root.keyboardRaised = focus; root.keyboardRaised = focus;
root.isPasswordField = (focus && passphraseField.echoMode === TextInput.Password); root.isPasswordField = (focus && passphraseField.echoMode === TextInput.Password);

View file

@ -923,7 +923,7 @@ Item {
anchors.leftMargin: 20; anchors.leftMargin: 20;
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: 20; anchors.rightMargin: 20;
height: 140; height: 95;
FontLoader { id: firaSansSemiBold; source: "../../../../../fonts/FiraSans-SemiBold.ttf"; } FontLoader { id: firaSansSemiBold; source: "../../../../../fonts/FiraSans-SemiBold.ttf"; }
TextArea { TextArea {
@ -947,8 +947,14 @@ Item {
wrapMode: TextEdit.Wrap; wrapMode: TextEdit.Wrap;
activeFocusOnPress: true; activeFocusOnPress: true;
activeFocusOnTab: true; activeFocusOnTab: true;
// Workaround for no max length on TextAreas
onTextChanged: { onTextChanged: {
// Don't allow tabs or newlines
if ((/[\n\r\t]/g).test(text)) {
var cursor = cursorPosition;
text = text.replace(/[\n\r\t]/g, '');
cursorPosition = cursor-1;
}
// Workaround for no max length on TextAreas
if (text.length > maximumLength) { if (text.length > maximumLength) {
var cursor = cursorPosition; var cursor = cursorPosition;
text = previousText; text = previousText;

View file

@ -131,7 +131,7 @@ Rectangle {
spacing: 5 spacing: 5
anchors.horizontalCenter: column3.horizontalCenter anchors.horizontalCenter: column3.horizontalCenter
anchors.horizontalCenterOffset: -20 anchors.horizontalCenterOffset: 0
Button { Button {
id: button1 id: button1

View file

@ -130,6 +130,7 @@ Item {
flickableDirection: Flickable.AutoFlickIfNeeded flickableDirection: Flickable.AutoFlickIfNeeded
keyNavigationEnabled: false keyNavigationEnabled: false
highlightFollowsCurrentItem: false highlightFollowsCurrentItem: false
interactive: false
property int previousGridIndex: -1 property int previousGridIndex: -1

View file

@ -434,9 +434,13 @@ void Rig::setJointRotation(int index, bool valid, const glm::quat& rotation, flo
bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm::vec3 translation, glm::quat rotation) const { bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm::vec3 translation, glm::quat rotation) const {
bool success { false }; bool success { false };
if (QThread::currentThread() == thread()) { glm::vec3 originalPosition = position;
bool onOwnerThread = (QThread::currentThread() == thread());
glm::vec3 poseSetTrans;
if (onOwnerThread) {
if (isIndexValid(jointIndex)) { if (isIndexValid(jointIndex)) {
position = (rotation * _internalPoseSet._absolutePoses[jointIndex].trans()) + translation; poseSetTrans = _internalPoseSet._absolutePoses[jointIndex].trans();
position = (rotation * poseSetTrans) + translation;
success = true; success = true;
} else { } else {
success = false; success = false;
@ -444,7 +448,8 @@ bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm:
} else { } else {
QReadLocker readLock(&_externalPoseSetLock); QReadLocker readLock(&_externalPoseSetLock);
if (jointIndex >= 0 && jointIndex < (int)_externalPoseSet._absolutePoses.size()) { if (jointIndex >= 0 && jointIndex < (int)_externalPoseSet._absolutePoses.size()) {
position = (rotation * _externalPoseSet._absolutePoses[jointIndex].trans()) + translation; poseSetTrans = _externalPoseSet._absolutePoses[jointIndex].trans();
position = (rotation * poseSetTrans) + translation;
success = true; success = true;
} else { } else {
success = false; success = false;
@ -452,7 +457,14 @@ bool Rig::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position, glm:
} }
if (isNaN(position)) { if (isNaN(position)) {
qCWarning(animation) << "Rig::getJointPositionInWorldFrame produces NaN"; qCWarning(animation) << "Rig::getJointPositionInWorldFrame produced NaN."
<< " is owner thread = " << onOwnerThread
<< " position = " << originalPosition
<< " translation = " << translation
<< " rotation = " << rotation
<< " poseSetTrans = " << poseSetTrans
<< " success = " << success
<< " jointIndex = " << jointIndex;
success = false; success = false;
position = glm::vec3(0.0f); position = glm::vec3(0.0f);
} }

View file

@ -331,9 +331,9 @@ void OffscreenSurface::finishQmlLoad(QQmlComponent* qmlComponent,
qmlComponent->deleteLater(); qmlComponent->deleteLater();
onItemCreated(qmlContext, newItem); onItemCreated(qmlContext, newItem);
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
if (!rootCreated) { if (!rootCreated) {
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
onRootCreated(); onRootCreated();
emit rootItemCreated(newItem); emit rootItemCreated(newItem);
// Call this callback after rootitem is set, otherwise VrMenu wont work // Call this callback after rootitem is set, otherwise VrMenu wont work

View file

@ -305,7 +305,6 @@ void OffscreenQmlSurface::onItemCreated(QQmlContext* qmlContext, QQuickItem* new
qmlContext->setContextProperty("eventBridgeWrapper", new EventBridgeWrapper(eventBridge, qmlContext)); qmlContext->setContextProperty("eventBridgeWrapper", new EventBridgeWrapper(eventBridge, qmlContext));
} }
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
} }
void OffscreenQmlSurface::onRootCreated() { void OffscreenQmlSurface::onRootCreated() {

View file

@ -509,15 +509,6 @@ function unbindAllInputs() {
} }
} }
function clearSelection() {
if (document.selection && document.selection.empty) {
document.selection.empty();
} else if (window.getSelection) {
var sel = window.getSelection();
sel.removeAllRanges();
}
}
function showParentMaterialNameBox(number, elNumber, elString) { function showParentMaterialNameBox(number, elNumber, elString) {
if (number) { if (number) {
$('#property-parent-material-id-number-container').show(); $('#property-parent-material-id-number-container').show();
@ -831,8 +822,10 @@ function loaded() {
if (lastEntityID !== '"' + properties.id + '"' && lastEntityID !== null && editor !== null) { if (lastEntityID !== '"' + properties.id + '"' && lastEntityID !== null && editor !== null) {
saveJSONUserData(true); saveJSONUserData(true);
} }
// the event bridge and json parsing handle our avatar id string differently.
var doSelectElement = lastEntityID === '"' + properties.id + '"';
// the event bridge and json parsing handle our avatar id string differently.
lastEntityID = '"' + properties.id + '"'; lastEntityID = '"' + properties.id + '"';
elID.value = properties.id; elID.value = properties.id;
@ -1214,12 +1207,10 @@ function loaded() {
} }
var activeElement = document.activeElement; var activeElement = document.activeElement;
if (doSelectElement && typeof activeElement.select !== "undefined") {
if (typeof activeElement.select !== "undefined") {
activeElement.select(); activeElement.select();
} }
} }
clearSelection();
} }
}); });
} }
@ -1787,34 +1778,13 @@ function loaded() {
}; };
// For input and textarea elements, select all of the text on focus // For input and textarea elements, select all of the text on focus
// WebKit-based browsers, such as is used with QWebView, have a quirk
// where the mouseup event comes after the focus event, causing the
// text to be deselected immediately after selecting all of the text.
// To make this work we block the first mouseup event after the elements
// received focus. If we block all mouseup events the user will not
// be able to click within the selected text.
// We also check to see if the value has changed to make sure we aren't
// blocking a mouse-up event when clicking on an input spinner.
var els = document.querySelectorAll("input, textarea"); var els = document.querySelectorAll("input, textarea");
for (var i = 0; i < els.length; i++) { for (var i = 0; i < els.length; i++) {
var clicked = false;
var originalText;
// TODO FIXME: (JSHint) Functions declared within loops referencing
// an outer scoped variable may lead to confusing semantics.
els[i].onfocus = function (e) { els[i].onfocus = function (e) {
originalText = this.value; e.target.select();
this.select();
clicked = false;
};
// TODO FIXME: (JSHint) Functions declared within loops referencing
// an outer scoped variable may lead to confusing semantics.
els[i].onmouseup = function(e) {
if (!clicked && originalText === this.value) {
e.preventDefault();
}
clicked = true;
}; };
} }
bindAllNonJSONEditorElements(); bindAllNonJSONEditorElements();
}); });