Clean up reply.

This commit is contained in:
Black Hat
2019-07-12 12:36:00 +08:00
parent 317222171d
commit a5d7dc396f
5 changed files with 9 additions and 18 deletions

View File

@@ -164,9 +164,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyUser = author
roomPanelInput.replyEventID = eventId
roomPanelInput.replyContent = message
roomPanelInput.replyModel = model
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -158,9 +158,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyUser = author
roomPanelInput.replyEventID = eventId
roomPanelInput.replyContent = message
roomPanelInput.replyModel = model
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -98,9 +98,7 @@ ColumnLayout {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})
contextMenu.reply.connect(function() {
roomPanelInput.replyUser = author
roomPanelInput.replyEventID = eventId
roomPanelInput.replyContent = contentLabel.selectedText || message
roomPanelInput.replyModel = model
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -173,9 +173,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyUser = author
roomPanelInput.replyEventID = eventId
roomPanelInput.replyContent = message
roomPanelInput.replyModel = model
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -13,9 +13,10 @@ import Spectral 0.1
Control {
property alias isReply: replyItem.visible
property var replyUser
property string replyEventID
property string replyContent
property var replyModel
readonly property var replyUser: replyModel ? replyModel.author : null
readonly property string replyEventID: replyModel ? replyModel.eventId : ""
readonly property string replyContent: replyModel ? replyModel.message : ""
property alias isAutoCompleting: autoCompleteListView.visible
property var autoCompleteModel
@@ -452,9 +453,7 @@ Control {
function clearReply() {
isReply = false
replyUser = null
replyEventID = ""
replyContent = ""
replyModel = null
}
function focus() {