mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 06:16:32 +00:00
417194e7b4
Add keyboard shortcuts according to https://notes.status.im/02cfVf1KQLeQU2SqrIi9tw fix: update chat message bubbles - Align emojis to middle of text - Add line-height as per design - Properly support RTL languages (right-aligned) and LTR languages (left-aligned) - Remove unneeded non-breaking space at the beginning of current user messages - Properly support markdown for bold, strikethrough, and italic - Fix text being removed when in between strikethrough markdown (~~) fix: emoji resolution update for high resolution monitors - Emojis now use the 72x72 original set, but are down-scaled to 20x20 (in chat bubbles) or 22x22 in other places, effectively tripling their pixel density feat: handle new lines in blockquote Handle new lines in blockquote so that messages display correctly. Also, add functionality when a new line is entered in to the chat input, if it's inside a blockquote, a new ">" will be added automatically. This is also handled when backspace is entered. feat: update xss to support full qt html4 table and table-cell attributes
101 lines
2.6 KiB
QML
101 lines
2.6 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
import QtGraphicalEffects 1.13
|
|
import "../../imports"
|
|
import "../../shared"
|
|
|
|
Rectangle {
|
|
id: root
|
|
height: 50
|
|
color: Style.current.lightGrey
|
|
radius: 16
|
|
clip: true
|
|
|
|
property string userName: ""
|
|
property string message : ""
|
|
property string identicon: ""
|
|
|
|
signal closeButtonClicked()
|
|
|
|
Rectangle {
|
|
color: parent.color
|
|
anchors.bottom: parent.bottom
|
|
anchors.right: parent.right
|
|
height: parent.height / 2
|
|
width: 32
|
|
radius: Style.current.radius
|
|
}
|
|
|
|
StyledText {
|
|
id: replyToUsername
|
|
text: "↪ " + userName
|
|
color: Style.current.black
|
|
anchors.top: parent.top
|
|
anchors.topMargin: Style.current.halfPadding
|
|
anchors.left: parent.left
|
|
anchors.leftMargin: Style.current.smallPadding
|
|
font.pixelSize: 13
|
|
font.weight: Font.Medium
|
|
}
|
|
|
|
StyledText {
|
|
id: replyText
|
|
text: Emoji.parse(message)
|
|
anchors.left: replyToUsername.left
|
|
anchors.top: replyToUsername.bottom
|
|
anchors.topMargin: 2
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: Style.current.padding
|
|
anchors.bottom: parent.bottom
|
|
elide: Text.ElideRight
|
|
font.pixelSize: 13
|
|
font.weight: Font.Normal
|
|
// Eliding only works for PlainText: https://bugreports.qt.io/browse/QTBUG-16567
|
|
textFormat: Text.PlainText
|
|
color: Style.current.black
|
|
}
|
|
|
|
RoundButton {
|
|
id: closeBtn
|
|
implicitWidth: 20
|
|
implicitHeight: 20
|
|
radius: 10
|
|
padding: 0
|
|
anchors.top: parent.top
|
|
anchors.topMargin: 4
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: 4
|
|
contentItem: SVGImage {
|
|
id: iconImg
|
|
source: "../../app/img/close.svg"
|
|
width: closeBtn.width
|
|
height: closeBtn.height
|
|
|
|
ColorOverlay {
|
|
anchors.fill: iconImg
|
|
source: iconImg
|
|
color: Style.current.black
|
|
antialiasing: true
|
|
}
|
|
}
|
|
background: Rectangle {
|
|
color: "transparent"
|
|
width: closeBtn.width
|
|
height: closeBtn.height
|
|
radius: closeBtn.radius
|
|
}
|
|
onClicked: {
|
|
root.userName = ""
|
|
root.message = ""
|
|
root.identicon = ""
|
|
root.closeButtonClicked()
|
|
}
|
|
MouseArea {
|
|
cursorShape: Qt.PointingHandCursor
|
|
anchors.fill: parent
|
|
onPressed: mouse.accepted = false
|
|
}
|
|
}
|
|
|
|
}
|