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

@ -10,7 +10,7 @@ import "avatarapp"
Rectangle { Rectangle {
id: root id: root
width: 480 width: 480
height: 706 height: 706
property bool keyboardEnabled: true property bool keyboardEnabled: true
property bool keyboardRaised: false property bool keyboardRaised: false
@ -415,7 +415,7 @@ Rectangle {
width: 21.2 width: 21.2
height: 19.3 height: 19.3
source: isAvatarInFavorites ? '../../images/FavoriteIconActive.svg' : '../../images/FavoriteIconInActive.svg' source: isAvatarInFavorites ? '../../images/FavoriteIconActive.svg' : '../../images/FavoriteIconInActive.svg'
anchors.verticalCenter: parent.verticalCenter Layout.alignment: Qt.AlignVCenter
} }
// TextStyle5 // TextStyle5
@ -424,7 +424,7 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
text: isAvatarInFavorites ? avatarName : "Add to Favorites" text: isAvatarInFavorites ? avatarName : "Add to Favorites"
elide: Qt.ElideRight elide: Qt.ElideRight
anchors.verticalCenter: parent.verticalCenter Layout.alignment: Qt.AlignVCenter
} }
} }

View file

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

View file

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

View file

@ -1779,7 +1779,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
updateHeartbeat(); updateHeartbeat();
QTimer* settingsTimer = new QTimer(); QTimer* settingsTimer = new QTimer();
moveToNewNamedThread(settingsTimer, "Settings Thread", [this, settingsTimer]{ moveToNewNamedThread(settingsTimer, "Settings Thread", [this, settingsTimer]{
// This needs to run on the settings thread, so we need to pass the `settingsTimer` as the // This needs to run on the settings thread, so we need to pass the `settingsTimer` as the
// receiver object, otherwise it will run on the application thread and trigger a warning // receiver object, otherwise it will run on the application thread and trigger a warning
// about trying to kill the timer on the main thread. // about trying to kill the timer on the main thread.
connect(qApp, &Application::beforeAboutToQuit, settingsTimer, [this, settingsTimer]{ connect(qApp, &Application::beforeAboutToQuit, settingsTimer, [this, settingsTimer]{
@ -2662,7 +2662,7 @@ Application::~Application() {
// shutdown graphics engine // shutdown graphics engine
_graphicsEngine.shutdown(); _graphicsEngine.shutdown();
_gameWorkload.shutdown(); _gameWorkload.shutdown();
DependencyManager::destroy<Preferences>(); DependencyManager::destroy<Preferences>();
@ -2838,6 +2838,8 @@ void Application::initializeDisplayPlugins() {
auto hmdDisplayPlugin = dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get()); auto hmdDisplayPlugin = dynamic_cast<HmdDisplayPlugin*>(displayPlugin.get());
QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdMountedChanged, QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdMountedChanged,
DependencyManager::get<HMDScriptingInterface>().data(), &HMDScriptingInterface::mountedChanged); 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); QObject::connect(hmdDisplayPlugin, &HmdDisplayPlugin::hmdVisibleChanged, this, &Application::hmdVisibleChanged);
} }
} }
@ -8572,7 +8574,7 @@ QUuid Application::getTabletFrameID() const {
} }
QVector<QUuid> Application::getTabletIDs() const { QVector<QUuid> Application::getTabletIDs() const {
// Most important overlays first. // Most important overlays first.
QVector<QUuid> result; QVector<QUuid> result;
auto HMD = DependencyManager::get<HMDScriptingInterface>(); auto HMD = DependencyManager::get<HMDScriptingInterface>();
result << HMD->getCurrentTabletScreenID(); result << HMD->getCurrentTabletScreenID();

View file

@ -15,7 +15,7 @@
// These properties have JSDoc documentation in HMDScriptingInterface.h. // These properties have JSDoc documentation in HMDScriptingInterface.h.
class AbstractHMDScriptingInterface : public QObject { class AbstractHMDScriptingInterface : public QObject {
Q_OBJECT 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 ipd READ getIPD)
Q_PROPERTY(float eyeHeight READ getEyeHeight) Q_PROPERTY(float eyeHeight READ getEyeHeight)
Q_PROPERTY(float playerHeight READ getPlayerHeight) Q_PROPERTY(float playerHeight READ getPlayerHeight)
@ -43,7 +43,7 @@ signals:
/**jsdoc /**jsdoc
* Triggered when Interface's display mode changes and when the user puts on or takes off their HMD. * Triggered when Interface's display mode changes and when the user puts on or takes off their HMD.
* @function HMD.displayModeChanged * @function HMD.displayModeChanged
* @param {boolean} isHMDMode - <code>true</code> if the display mode is HMD, otherwise <code>false</code>. This is the * @param {boolean} isHMDMode - <code>true</code> if the display mode is HMD, otherwise <code>false</code>. This is the
* same value as provided by <code>HMD.active</code>. * same value as provided by <code>HMD.active</code>.
* @returns {Signal} * @returns {Signal}
* @example <caption>Report when the display mode changes.</caption> * @example <caption>Report when the display mode changes.</caption>
@ -67,6 +67,8 @@ signals:
*/ */
void mountedChanged(); void mountedChanged();
void activeChanged();
private: private:
float _IPDScale{ 1.0 }; float _IPDScale{ 1.0 };
}; };