Add reply GUI controls

This commit is contained in:
miruka
2020-05-20 05:19:06 -04:00
parent 5128f0d888
commit aa8d3cf8d3
10 changed files with 75 additions and 1 deletions

View File

@@ -22,6 +22,9 @@ Item {
property bool ready: Boolean(userInfo && roomInfo)
property bool longLoading: false
property string replyToUserId: ""
property string replyToDisplayName: ""
readonly property alias loader: loader
readonly property alias roomPane: roomPaneLoader.item

View File

@@ -64,6 +64,18 @@ HColumnPage {
TypingMembersBar {
typingMembers: JSON.parse(chat.roomInfo.typing_members)
Layout.fillWidth: true
}
ReplyBar {
replyToUserId: chat.replyToUserId
replyToDisplayName: chat.replyToDisplayName
onCancel: {
chat.replyToUserId = ""
chat.replyToDisplayName = ""
}
Layout.fillWidth: true
}

View File

@@ -11,12 +11,14 @@ Rectangle {
readonly property alias icon: icon
readonly property alias label: label
default property alias rowLayoutData: rowLayout.data
Behavior on implicitHeight { HNumberAnimation {} }
HRowLayout {
id: rowLayout
width: parent.width
spacing: theme.spacing
HIcon {

View File

@@ -0,0 +1,35 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../../Base"
InfoBar {
color: theme.chat.replyBar.background
icon.svgName: "reply-to"
label.textFormat: Text.StyledText
label.text:
replyToUserId ?
utils.coloredNameHtml(replyToDisplayName, replyToUserId) :
""
signal cancel()
property string replyToUserId: ""
property string replyToDisplayName: ""
HButton {
backgroundColor: "transparent"
icon.name: "reply-cancel"
icon.color: theme.colors.negativeBackground
// iconItem.small: true
// topPadding: 0
// bottomPadding: topPadding
onClicked: cancel()
Layout.fillHeight: true
}
}

View File

@@ -228,6 +228,16 @@ HColumnLayout {
}
}
HMenuItem {
icon.name: "reply-to"
text: qsTr("Reply")
onTriggered: {
chat.replyToUserId = model.sender_id
chat.replyToDisplayName = model.sender_name
}
}
HMenuItemPopupSpawner {
icon.name: "remove-message"
text: qsTr("Remove")