Add reply GUI controls
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
|
35
src/gui/Pages/Chat/ReplyBar.qml
Normal file
35
src/gui/Pages/Chat/ReplyBar.qml
Normal 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
|
||||
}
|
||||
}
|
@@ -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")
|
||||
|
Reference in New Issue
Block a user