From 2357934d49a3f0679d786477aa9b828ad345aa5d Mon Sep 17 00:00:00 2001 From: RebeccaStankus Date: Fri, 16 Aug 2019 12:08:26 -0700 Subject: [PATCH] Working tooltips --- .../simplifiedEmote/simplifiedEmote.js | 21 ++++++++----- .../ui/qml/SimplifiedEmoteIndicator.qml | 30 ++++++++++++++----- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/scripts/simplifiedUI/simplifiedEmote/simplifiedEmote.js b/scripts/simplifiedUI/simplifiedEmote/simplifiedEmote.js index 6c6e60d567..df5506d41c 100644 --- a/scripts/simplifiedUI/simplifiedEmote/simplifiedEmote.js +++ b/scripts/simplifiedUI/simplifiedEmote/simplifiedEmote.js @@ -197,13 +197,6 @@ function endReactionWrapper(reaction) { } -/* - MILAD NOTE: - Right now you can do more than one reaction at a time so it has to be handled here. - I might see about adding a small flag to the engine so that if a reaction is currently playing it will end it. - This will cut down on a lot of boiler code below checking to see if another reaction is playing. Also because it doesn't - make sense for more than one reaction to be playing. -*/ var EMOTE_APP_BAR_MESSAGE_SOURCE = "EmoteAppBar.qml"; function onMessageFromEmoteAppBar(message) { console.log("MESSAGE From emote app bar: ", JSON.stringify(message)); @@ -213,9 +206,23 @@ function onMessageFromEmoteAppBar(message) { switch (message.method) { case "positive": triggerReactionWrapper("positive"); + emoteAppBarWindow.sendToQml({ + "source": "simplifiedEmote.js", + "method": "updateEmoteIndicator", + "data": { + "icon": message.method + } + }); break; case "negative": triggerReactionWrapper("negative"); + emoteAppBarWindow.sendToQml({ + "source": "simplifiedEmote.js", + "method": "updateEmoteIndicator", + "data": { + "icon": message.method + } + }); break; case "raiseHand": case "applaud": diff --git a/scripts/simplifiedUI/simplifiedEmote/ui/qml/SimplifiedEmoteIndicator.qml b/scripts/simplifiedUI/simplifiedEmote/ui/qml/SimplifiedEmoteIndicator.qml index 4de13d639e..61f88e52d0 100644 --- a/scripts/simplifiedUI/simplifiedEmote/ui/qml/SimplifiedEmoteIndicator.qml +++ b/scripts/simplifiedUI/simplifiedEmote/ui/qml/SimplifiedEmoteIndicator.qml @@ -83,6 +83,8 @@ Rectangle { Tablet.playSound(TabletEnums.ButtonHover); } } + + } Row { @@ -97,12 +99,12 @@ Rectangle { id: emoteButtonsRepeater model: ListModel { id: buttonsModel - ListElement { imageURL: "images/positive_Icon.svg"; method: "positive" } - ListElement { imageURL: "images/negative_Icon.svg"; method: "negative" } - ListElement { imageURL: "images/raiseHand_Icon.svg"; method: "raiseHand" } - ListElement { imageURL: "images/applaud_Icon.svg"; method: "applaud" } - ListElement { imageURL: "images/point_Icon.svg"; method: "point" } - ListElement { imageURL: "images/emote_Icon.svg"; method: "toggleEmojiApp" } + ListElement { imageURL: "images/positive_Icon.svg"; hotkey: "Z"; method: "positive" } + ListElement { imageURL: "images/negative_Icon.svg"; hotkey: "X"; method: "negative" } + ListElement { imageURL: "images/raiseHand_Icon.svg"; hotkey: "C"; method: "raiseHand" } + ListElement { imageURL: "images/applaud_Icon.svg"; hotkey: "V"; method: "applaud" } + ListElement { imageURL: "images/point_Icon.svg"; hotkey: "B"; method: "point" } + ListElement { imageURL: "images/emote_Icon.svg"; hotkey: "N"; method: "toggleEmojiApp" } } Rectangle { @@ -136,6 +138,19 @@ Rectangle { onEntered: { Tablet.playSound(TabletEnums.ButtonHover); } + + Rectangle { + anchors.bottom: parent.bottom + anchors.right: parent.right + height: 1 + width: 20 + color: "transparent" + + ToolTip { + text: model.hotkey + visible: emoteTrayMouseArea.containsMouse + } + } } ColorOverlay { @@ -156,14 +171,13 @@ Rectangle { switch (message.method) { case "updateEmoteIndicator": if (message.data.icon) { - print("CHANGING INDICATOR TO: ", message.data.icon); + print("CHANGING INDICATOR TO: ", message.data.icon); var imageURL = "images/" + message.data.icon + "_Icon.svg"; emoteIndicator.source = imageURL; } break; default: - print("MESSAGE TO THE EMOTE INDICATOR QML RECEIVED: ", JSON.stringify(message)); console.log('SimplifiedEmoteIndicator.qml: Unrecognized message from JS'); break; }