Add reply GUI controls
This commit is contained in:
parent
5128f0d888
commit
aa8d3cf8d3
2
TODO.md
2
TODO.md
|
@ -88,7 +88,7 @@
|
||||||
- Animate `DayBreak` apparition
|
- Animate `DayBreak` apparition
|
||||||
|
|
||||||
- Device settings
|
- Device settings
|
||||||
- Replies
|
- Proparly formatted rich replies
|
||||||
- Messages editing
|
- Messages editing
|
||||||
- Code highlighting
|
- Code highlighting
|
||||||
- Adapt shortcuts flicking speed to font size
|
- Adapt shortcuts flicking speed to font size
|
||||||
|
|
|
@ -22,6 +22,9 @@ Item {
|
||||||
property bool ready: Boolean(userInfo && roomInfo)
|
property bool ready: Boolean(userInfo && roomInfo)
|
||||||
property bool longLoading: false
|
property bool longLoading: false
|
||||||
|
|
||||||
|
property string replyToUserId: ""
|
||||||
|
property string replyToDisplayName: ""
|
||||||
|
|
||||||
readonly property alias loader: loader
|
readonly property alias loader: loader
|
||||||
readonly property alias roomPane: roomPaneLoader.item
|
readonly property alias roomPane: roomPaneLoader.item
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,18 @@ HColumnPage {
|
||||||
|
|
||||||
TypingMembersBar {
|
TypingMembersBar {
|
||||||
typingMembers: JSON.parse(chat.roomInfo.typing_members)
|
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
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,14 @@ Rectangle {
|
||||||
|
|
||||||
readonly property alias icon: icon
|
readonly property alias icon: icon
|
||||||
readonly property alias label: label
|
readonly property alias label: label
|
||||||
|
default property alias rowLayoutData: rowLayout.data
|
||||||
|
|
||||||
|
|
||||||
Behavior on implicitHeight { HNumberAnimation {} }
|
Behavior on implicitHeight { HNumberAnimation {} }
|
||||||
|
|
||||||
HRowLayout {
|
HRowLayout {
|
||||||
id: rowLayout
|
id: rowLayout
|
||||||
|
width: parent.width
|
||||||
spacing: theme.spacing
|
spacing: theme.spacing
|
||||||
|
|
||||||
HIcon {
|
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 {
|
HMenuItemPopupSpawner {
|
||||||
icon.name: "remove-message"
|
icon.name: "remove-message"
|
||||||
text: qsTr("Remove")
|
text: qsTr("Remove")
|
||||||
|
|
3
src/icons/thin/reply-cancel.svg
Normal file
3
src/icons/thin/reply-cancel.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m23 20.168-8.185-8.187 8.185-8.174-2.832-2.807-8.182 8.179-8.176-8.179-2.81 2.81 8.186 8.196-8.186 8.184 2.81 2.81 8.203-8.192 8.18 8.192z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 246 B |
3
src/icons/thin/reply-to.svg
Normal file
3
src/icons/thin/reply-to.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg height="17" viewBox="0 0 18 17" width="18" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m7 4.5402542v-4.5402542l-7 7 7 7v-4.6402542c5 0 8.5 2.1402542 11 5.6402542-1-5-4-9.4597458-11-10.4597458z" fill-rule="evenodd" transform="translate(0 .5)"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 261 B |
|
@ -445,6 +445,9 @@ chat:
|
||||||
colors.hue, colors.saturation, colors.intensity * 9, 0.52
|
colors.hue, colors.saturation, colors.intensity * 9, 0.52
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replyBar:
|
||||||
|
color background: chat.typingMembers.background
|
||||||
|
|
||||||
fileTransfer:
|
fileTransfer:
|
||||||
color background: chat.typingMembers.background
|
color background: chat.typingMembers.background
|
||||||
|
|
||||||
|
|
|
@ -454,6 +454,9 @@ chat:
|
||||||
colors.hue, colors.saturation, colors.intensity * 9, 0.52
|
colors.hue, colors.saturation, colors.intensity * 9, 0.52
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replyBar:
|
||||||
|
color background: chat.typingMembers.background
|
||||||
|
|
||||||
fileTransfer:
|
fileTransfer:
|
||||||
color background: chat.typingMembers.background
|
color background: chat.typingMembers.background
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user