From 56194bba8e69d8946543f2fb42af52fc303928f6 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Wed, 8 Aug 2018 23:57:08 +0300 Subject: [PATCH] bind 'is soft' to backend API, always show 'Hips' for soften entity --- .../qml/hifi/avatarapp/AdjustWearables.qml | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml index 8ea3827f9c..158757770c 100644 --- a/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml +++ b/interface/resources/qml/hifi/avatarapp/AdjustWearables.qml @@ -48,11 +48,7 @@ Rectangle { } wearablesCombobox.model.append(wearable); } - wearablesCombobox.currentIndex = 0; - if(wearablesCombobox.model.count !== 0) { - jointsCombobox.set(getCurrentWearable().parentJointIndex) - } } function refreshWearable(wearableID, wearableIndex, properties, updateUI) { @@ -176,6 +172,7 @@ Rectangle { rotation.set(currentWearable.localRotationAngles); scalespinner.set(currentWearable.dimensions.x / currentWearable.naturalDimensions.x) jointsCombobox.set(currentWearable.parentJointIndex) + isSoft.set(currentWearable.relayParentJoints) wearableSelected(currentWearable.id); } @@ -197,6 +194,8 @@ Rectangle { id: jointsCombobox anchors.left: parent.left anchors.right: parent.right + enabled: !isSoft.checked + comboBox.displayText: isSoft.checked ? 'Hips' : comboBox.currentText model: jointNames property bool notify: false @@ -350,11 +349,31 @@ Rectangle { height: childrenRect.height HifiControlsUit.CheckBox { + id: isSoft text: "Is soft" labelFontSize: 15 labelFontWeight: Font.Bold color: Qt.black y: scalespinner.y + + function set(value) { + notify = false; + checked = value + notify = true; + } + + function notifyIsSoftChanged() { + modified = true; + var properties = { + relayParentJoints: checked + }; + + wearableUpdated(getCurrentWearable().id, wearablesCombobox.currentIndex, properties); + } + + property bool notify: false; + + onCheckedChanged: if(notify) notifyIsSoftChanged(); } Column {