Fix line strike.

Fix code block wrapping.
Fix replyModel being garbage collected.
Reply message in RoomPanelInput is richtext now.
This commit is contained in:
Black Hat
2019-09-29 20:29:59 -07:00
parent 887f69fac3
commit 617855a780
11 changed files with 131 additions and 42 deletions

View File

@@ -25,6 +25,26 @@ Rectangle {
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
@@ -39,6 +59,26 @@ Rectangle {
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
@@ -53,6 +93,26 @@ Rectangle {
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
@@ -67,5 +127,25 @@ Rectangle {
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
}

View File

@@ -164,7 +164,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyModel = model
roomPanelInput.replyModel = Object.assign({}, model)
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -158,7 +158,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyModel = model
roomPanelInput.replyModel = Object.assign({}, model)
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -72,7 +72,7 @@ ColumnLayout {
padding: 0
background: AutoRectangle {
readonly property int minorRadius: 2
readonly property int minorRadius: 8
id: bubbleBackground
@@ -100,7 +100,7 @@ ColumnLayout {
messageSourceDialog.createObject(ApplicationWindow.overlay, {"sourceText": toolTip}).open()
})
contextMenu.reply.connect(function() {
roomPanelInput.replyModel = model
roomPanelInput.replyModel = Object.assign({}, model)
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -173,7 +173,7 @@ RowLayout {
contextMenu.downloadAndOpen.connect(downloadAndOpen)
contextMenu.saveFileAs.connect(saveFileAs)
contextMenu.reply.connect(function() {
roomPanelInput.replyModel = model
roomPanelInput.replyModel = Object.assign({}, model)
roomPanelInput.isReply = true
roomPanelInput.focus()
})

View File

@@ -16,7 +16,7 @@ Control {
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 : ""
readonly property string replyContent: replyModel ? replyModel.display : ""
property alias isAutoCompleting: autoCompleteListView.visible
property var autoCompleteModel
@@ -62,13 +62,20 @@ Control {
hint: replyUser ? replyUser.displayName : "No name"
}
Label {
TextEdit {
Layout.fillWidth: true
text: replyContent
font.pixelSize: 14
color: MPalette.foreground
text: "<style>a{color: " + color + ";} .user-pill{}</style>" + replyContent
font.family: window.font.family
font.pixelSize: 14
selectByMouse: true
readOnly: true
wrapMode: Label.Wrap
selectedTextColor: "white"
selectionColor: MPalette.accent
textFormat: Text.RichText
}
}