Skip to content
Snippets Groups Projects
Verified Commit 0078c72a authored by Joe Donofry's avatar Joe Donofry
Browse files

Remove signals in favor of direct function calls

parent 75cdc1ee
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,6 @@ import QtQuick.Controls 2.2
// adding new reactions via the emoji picker
Flow {
id: reactionFlow
// Signal for when a reaction is picked / unpicked
signal picked(string room_id, string event_id, string key, string selfReactedEvent)
// highlight colors for selfReactedEvent background
property real highlightHue: colors.highlight.hslHue
......@@ -36,7 +34,7 @@ Flow {
onClicked: {
console.debug("Picked " + model.key + "in response to " + reactionFlow.eventId + " in room " + reactionFlow.roomId + ". selfReactedEvent: " + model.selfReactedEvent)
reactionFlow.picked(reactionFlow.roomId, reactionFlow.eventId, model.key, model.selfReactedEvent)
timelineManager.reactToMessage(reactionFlow.roomId, reactionFlow.eventId, model.key, model.selfReactedEvent)
}
......@@ -57,7 +55,7 @@ Flow {
Text {
anchors.baseline: reactionCounter.baseline
id: reactionText
text: textMetrics.elidedText + (textMetrics.elidedText == textMetrics.text ? "" : "")
text: textMetrics.elidedText + (textMetrics.elidedText == model.key ? "" : "")
font.family: settings.emojiFont
color: reaction.hovered ? colors.highlight : colors.text
maximumLineCount: 1
......
......@@ -63,9 +63,6 @@ MouseArea {
reactions: model.reactions
roomId: model.roomId
eventId: model.id
Component.onCompleted: {
reactionRow.picked.connect(timelineManager.reactToMessage)
}
}
}
......
......@@ -34,9 +34,6 @@ Page {
category: Emoji.Category.People
sourceModel: EmojiModel {}
}
Component.onCompleted: {
emojiPopup.picked.connect(timelineManager.queueReactionMessage)
}
}
Menu {
......
......@@ -10,7 +10,7 @@ import "../"
Popup {
function show(showAt, room_id, event_id) {
function show(showAt, room_id, event_id) {
console.debug("Showing emojiPicker for " + event_id + "in room " + room_id)
parent = showAt
x = Math.round((showAt.width - width) / 2)
......@@ -18,8 +18,7 @@ Popup {
emojiPopup.room_id = room_id
emojiPopup.event_id = event_id
open()
}
signal picked(string room_id, string event_id, string key)
}
property string room_id
property string event_id
......@@ -42,8 +41,6 @@ Popup {
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
onPicked: emojiPopup.close()
ColumnLayout {
id: columnView
anchors.fill: parent
......@@ -106,7 +103,8 @@ Popup {
// TODO: maybe add favorites at some point?
onClicked: {
console.debug("Picked " + model.unicode + "in response to " + emojiPopup.event_id + " in room " + emojiPopup.room_id)
emojiPopup.picked(emojiPopup.room_id, emojiPopup.event_id, model.unicode)
emojiPopup.close()
timelineManager.queueReactionMessage(emojiPopup.room_id, emojiPopup.event_id, model.unicode)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment