Indicator image swapping

This commit is contained in:
RebeccaStankus 2019-08-15 17:20:27 -07:00
parent 876ae771d4
commit a06cb85f9e
5 changed files with 15 additions and 6 deletions

View file

@ -131,6 +131,13 @@ function toggleReaction(reaction) {
if (reactionEnding) {
endReactionWrapper(reaction);
emoteAppBarWindow.sendToQml({
"source": "simplifiedEmote.js",
"method": "updateEmoteIndicator",
"data": {
"icon": "emote"
}
});
} else {
beginReactionWrapper(reaction);
}
@ -215,6 +222,7 @@ function onMessageFromEmoteAppBar(message) {
console.log("Unrecognized message from " + EMOTE_APP_BAR_MESSAGE_SOURCE + ": " + JSON.stringify(message));
break;
}
emoteAppBarWindow.sendToQml({
"source": "simplifiedEmote.js",
"method": "updateEmoteIndicator",

View file

@ -65,7 +65,6 @@ Rectangle {
ColorOverlay {
anchors.fill: emoteIndicator
opacity: emoteIndicatorMouseArea.containsMouse ? 1.0 : 0.7
source: emoteIndicator
color: "#ffffff"
}
@ -98,10 +97,10 @@ Rectangle {
id: emoteButtonsRepeater
model: ListModel {
id: buttonsModel
ListElement { imageURL: "images/happy_Icon.svg"; method: "positive" }
ListElement { imageURL: "images/sad_Icon.svg"; method: "negative" }
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/clap_Icon.svg"; method: "applaud" }
ListElement { imageURL: "images/applaud_Icon.svg"; method: "applaud" }
ListElement { imageURL: "images/point_Icon.svg"; method: "point" }
ListElement { imageURL: "images/emote_Icon.svg"; method: "toggleEmojiApp" }
}
@ -157,10 +156,12 @@ Rectangle {
switch (message.method) {
case "updateEmoteIndicator":
if (message.data.icon) {
print("UPDATING EMOTE INDICATOR");
emoteIndicator.text = message.data.icon[0];
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');

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 877 B

After

Width:  |  Height:  |  Size: 877 B

View file

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 882 B