Fix Avatar apps warnings. Added notification for HMD.active property

This commit is contained in:
vladest 2018-12-08 19:12:02 +01:00
parent 4e7a777fda
commit c05e3e7d09
5 changed files with 22 additions and 20 deletions

View file

@ -415,7 +415,7 @@ Rectangle {
width: 21.2
height: 19.3
source: isAvatarInFavorites ? '../../images/FavoriteIconActive.svg' : '../../images/FavoriteIconInActive.svg'
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
// TextStyle5
@ -424,7 +424,7 @@ Rectangle {
Layout.fillWidth: true
text: isAvatarInFavorites ? avatarName : "Add to Favorites"
elide: Qt.ElideRight
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
}

View file

@ -226,7 +226,7 @@ Rectangle {
lineHeightMode: Text.FixedHeight
lineHeight: 18;
text: "Wearable"
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
spacing: 10
@ -237,7 +237,7 @@ Rectangle {
lineHeight: 18;
text: "<a href='#'>Get more</a>"
linkColor: hifi.colors.blueHighlight
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
onLinkActivated: {
popup.showGetWearables(function() {
emitSendToScript({'method' : 'navigate', 'url' : 'hifi://AvatarIsland/11.5848,-8.10862,-2.80195'})

View file

@ -103,11 +103,11 @@ Rectangle {
size: 17;
text: "Avatar Scale"
verticalAlignment: Text.AlignVCenter
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
RowLayout {
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
spacing: 0
@ -117,7 +117,7 @@ Rectangle {
text: 'T'
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
HifiControlsUit.Slider {
@ -135,7 +135,7 @@ Rectangle {
}
}
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
// TextStyle9
@ -164,7 +164,7 @@ Rectangle {
text: 'T'
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
}
@ -327,8 +327,7 @@ Rectangle {
InputTextStyle4 {
id: avatarAnimationUrlInputText
font.pixelSize: 17
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
placeholderText: 'user\\file\\dir'
onFocusChanged: {
@ -357,8 +356,7 @@ Rectangle {
InputTextStyle4 {
id: avatarCollisionSoundUrlInputText
font.pixelSize: 17
anchors.left: parent.left
anchors.right: parent.right
Layout.fillWidth: true
placeholderText: 'https://hifi-public.s3.amazonaws.com/sounds/Collisions-'
onFocusChanged: {

View file

@ -2838,6 +2838,8 @@ void Application::initializeDisplayPlugins() {
auto hmdDisplayPlugin = dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get());
QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdMountedChanged,
DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::mountedChanged);
QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdMountedChanged,
DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::activeChanged);
QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdVisibleChanged, this, &Application::hmdVisibleChanged);
}
}

View file

@ -15,7 +15,7 @@
// These properties have JSDoc documentation in HMDScriptingInterface.h.
class AbstractHMDScriptingInterface : public QObject {
Q_OBJECT
Q_PROPERTY(bool active READ isHMDMode)
Q_PROPERTY(bool active READ isHMDMode NOTIFY activeChanged)
Q_PROPERTY(float ipd READ getIPD)
Q_PROPERTY(float eyeHeight READ getEyeHeight)
Q_PROPERTY(float playerHeight READ getPlayerHeight)
@ -67,6 +67,8 @@ signals:
*/
void mountedChanged();
void activeChanged();
private:
float _IPDScale{ 1.0 };
};