mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
Remove signals in favor of direct function calls
This commit is contained in:
parent
75cdc1eee2
commit
0078c72a37
4 changed files with 6 additions and 16 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue