mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
focus message input on adding emoji/reacting to a message
This commit is contained in:
parent
f02342fe22
commit
4aefac08a4
4 changed files with 15 additions and 0 deletions
|
@ -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();
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue