Changeset View
Changeset View
Standalone View
Standalone View
src/contents/ui/SendMessageBox.qml
| Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | TextArea { | ||||
| if (drag.hasUrls) { | if (drag.hasUrls) { | ||||
| confirmUploadPopup.call(drag.urls); | confirmUploadPopup.call(drag.urls); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ToolButton { | ToolButton { | ||||
| icon.name: "document-open-data" | action: sendMediaFileAction | ||||
| onClicked: sendMediaFileAction.trigger() | display: AbstractButton.IconOnly | ||||
| } | } | ||||
| ToolButton { | ToolButton { | ||||
| action: stickersAction | action: stickersAction | ||||
| display: AbstractButton.IconOnly | display: AbstractButton.IconOnly | ||||
| } | } | ||||
| ToolButton { | ToolButton { | ||||
| icon.name: "document-send" | action: sendAction | ||||
| onClicked: sendAction.trigger() | display: AbstractButton.IconOnly | ||||
| } | } | ||||
| } | } | ||||
| function mentionUser(userId) { | function mentionUser(userId) { | ||||
| const prefix = textArea.text.slice(0, textArea.cursorPosition); | const prefix = textArea.text.slice(0, textArea.cursorPosition); | ||||
| const suffix = textArea.text.slice(textArea.cursorPosition); | const suffix = textArea.text.slice(textArea.cursorPosition); | ||||
| let insertion = userId; | let insertion = userId; | ||||
| // If we are not at the beginning and the prev char is not a space, | // If we are not at the beginning and the prev char is not a space, | ||||
| Show All 38 Lines | onTriggered: { | ||||
| room.setTyping(false); | room.setTyping(false); | ||||
| room.sendTextMessage(textArea.text, draftRelType, draftRelatedTo); | room.sendTextMessage(textArea.text, draftRelType, draftRelatedTo); | ||||
| textArea.changeText("", true); | textArea.changeText("", true); | ||||
| sendMessageBox.draftRelType = ''; | sendMessageBox.draftRelType = ''; | ||||
| sendMessageBox.draftRelatedTo = ''; | sendMessageBox.draftRelatedTo = ''; | ||||
| } | } | ||||
| } | } | ||||
| Kirigami.Action { | Kirigami.Action { | ||||
| id:sendMediaFileAction | id: sendMediaFileAction | ||||
| icon.name: "mail-attachment-symbolic" | icon.name: "document-open-data" | ||||
| text: l10n.get("send-message-box-send-file") | text: l10n.get("send-message-box-send-file") | ||||
| onTriggered: { | onTriggered: { | ||||
| fileDialog.open() | fileDialog.open() | ||||
| } | } | ||||
| } | } | ||||
| property var confirmUploadPopup: ConfirmUploadPopup { | property var confirmUploadPopup: ConfirmUploadPopup { | ||||
| id: confirmUploadPopup | id: confirmUploadPopup | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||