Skip to content
Snippets Groups Projects
Commit 4aefac08 authored by Jedi18's avatar Jedi18
Browse files

focus message input on adding emoji/reacting to a message

parent f02342fe
No related branches found
No related tags found
No related merge requests found
Pipeline #582 failed
......@@ -270,6 +270,11 @@ Rectangle {
target: TimelineManager.timeline
}
Connections {
target: TimelineManager
onFocusInput: messageInput.forceActiveFocus()
}
MouseArea {
// workaround for wrong cursor shape on some platforms
anchors.fill: parent
......@@ -297,6 +302,7 @@ Rectangle {
ToolTip.text: qsTr("Emoji")
onClicked: emojiPopup.visible ? emojiPopup.close() : emojiPopup.show(emojiButton, function(emoji) {
messageInput.insert(messageInput.cursorPosition, emoji);
TimelineManager.focusMessageInput()
})
}
......
......@@ -14,5 +14,6 @@ ImageButton {
image: ":/icons/icons/ui/smile.png"
onClicked: emojiPicker.visible ? emojiPicker.close() : emojiPicker.show(emojiButton, function(emoji) {
TimelineManager.queueReactionMessage(event_id, emoji);
TimelineManager.focusMessageInput()
})
}
......@@ -545,3 +545,9 @@ TimelineViewManager::queueCallMessage(const QString &roomid,
{
models.value(roomid)->sendMessageEvent(callHangUp, mtx::events::EventType::CallHangUp);
}
void
TimelineViewManager::focusMessageInput()
{
emit focusInput();
}
\ No newline at end of file
......@@ -66,6 +66,7 @@ public:
Q_INVOKABLE void openLink(QString link) const;
Q_INVOKABLE void focusMessageInput();
Q_INVOKABLE void openInviteUsersDialog();
Q_INVOKABLE void openMemberListDialog() const;
Q_INVOKABLE void openLeaveRoomDialog() const;
......@@ -87,6 +88,7 @@ signals:
void showRoomList();
void narrowViewChanged();
void focusChanged();
void focusInput();
public slots:
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);
......
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