From b9b320d01c89ac2dca1726e0f95d0c8f74437b7f Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 31 May 2019 11:43:13 -0700 Subject: [PATCH 1/4] DEV-92: Add a Home button to the Avatar app --- .../hifi/simplifiedUI/avatarApp/AvatarApp.qml | 21 +++++++++++++++++++ .../avatarApp/images/homeIcon.svg | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 interface/resources/qml/hifi/simplifiedUI/avatarApp/images/homeIcon.svg diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index d6ee593edd..b7186b885c 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -99,6 +99,27 @@ Rectangle { } } + Image { + id: homeButton + source: "images/homeIcon.svg" + opacity: homeButtonMouseArea.containsMouse ? 1.0 : 0.7 + anchors.top: parent.top + anchors.topMargin: 15 + anchors.right: parent.right + anchors.rightMargin: 24 + width: 14 + height: 13 + + MouseArea { + id: homeButtonMouseArea + anchors.fill: parent + hoverEnabled: true + onClicked: { + Window.location = LocationBookmarks.getHomeLocationAddress(); + } + } + } + AvatarAppComponents.DisplayNameHeader { id: displayNameHeader previewUrl: root.avatarPreviewUrl diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/images/homeIcon.svg b/interface/resources/qml/hifi/simplifiedUI/avatarApp/images/homeIcon.svg new file mode 100644 index 0000000000..1aae14e2dd --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/images/homeIcon.svg @@ -0,0 +1,4 @@ + + + + From 25725bb91e6dd64101a9f533a48029dc2855e27d Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 31 May 2019 11:46:13 -0700 Subject: [PATCH 2/4] Change 'your avatars' to 'your profile' --- scripts/simplifiedUI/ui/simplifiedUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index a6183c5ab9..38d1059da7 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -98,7 +98,7 @@ function onAvatarAppClosed() { var AVATAR_APP_QML_PATH = Script.resourcesPath() + "qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml"; -var AVATAR_APP_WINDOW_TITLE = "Your Avatars"; +var AVATAR_APP_WINDOW_TITLE = "Your Profile"; var AVATAR_APP_PRESENTATION_MODE = Desktop.PresentationMode.NATIVE; var AVATAR_APP_WIDTH_PX = 480; var AVATAR_APP_HEIGHT_PX = 615; From 8b085c79addbf051e78600df137a676b14716c4a Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 31 May 2019 12:36:28 -0700 Subject: [PATCH 3/4] Can't use window.location in QML --- .../resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index b7186b885c..66bbc99ad4 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -115,7 +115,9 @@ Rectangle { anchors.fill: parent hoverEnabled: true onClicked: { - Window.location = LocationBookmarks.getHomeLocationAddress(); + // Can't use `Window.location` in QML, so just use what setting `Window.location` actually calls under the hood: + // AddressManager.handleLookupString(). + AddressManager.handleLookupString(LocationBookmarks.getHomeLocationAddress()); } } } From 7b04a6d361e78f0f0b27eb509f84db7fd555d03b Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 31 May 2019 12:37:35 -0700 Subject: [PATCH 4/4] Sounds --- .../resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index 66bbc99ad4..4c6615ebdc 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -12,6 +12,7 @@ import QtQuick 2.10 import "../simplifiedConstants" as SimplifiedConstants import "./components" as AvatarAppComponents import stylesUit 1.0 as HifiStylesUit +import TabletScriptingInterface 1.0 import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere. Rectangle { @@ -114,7 +115,11 @@ Rectangle { id: homeButtonMouseArea anchors.fill: parent hoverEnabled: true + onEntered: { + Tablet.playSound(TabletEnums.ButtonHover); + } onClicked: { + Tablet.playSound(TabletEnums.ButtonClick); // Can't use `Window.location` in QML, so just use what setting `Window.location` actually calls under the hood: // AddressManager.handleLookupString(). AddressManager.handleLookupString(LocationBookmarks.getHomeLocationAddress());