mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Port redacted messages
This commit is contained in:
parent
eab8731f5b
commit
466d3cd52c
2 changed files with 31 additions and 13 deletions
|
@ -285,6 +285,19 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EventDelegateChoice {
|
||||||
|
roleValues: [
|
||||||
|
MtxEvent.Redacted
|
||||||
|
]
|
||||||
|
|
||||||
|
Redacted {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
required property string userId
|
||||||
|
required property string userName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EventDelegateChoice {
|
EventDelegateChoice {
|
||||||
roleValues: [
|
roleValues: [
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,20 +7,16 @@ import QtQuick.Controls 2.15
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
|
||||||
Rectangle{
|
Control {
|
||||||
|
id: msgRoot
|
||||||
|
|
||||||
height: redactedLayout.implicitHeight + Nheko.paddingSmall
|
property int metadataWidth: 0
|
||||||
implicitWidth: redactedLayout.implicitWidth + 2 * Nheko.paddingMedium
|
property bool fitsMetadata: false //parent.width - redactedLayout.width > metadataWidth + 4
|
||||||
width: Math.min(parent.width,implicitWidth+1)
|
|
||||||
radius: fontMetrics.lineSpacing / 2 + 2 * Nheko.paddingSmall
|
|
||||||
color: palette.alternateBase
|
|
||||||
property int metadataWidth
|
|
||||||
property bool fitsMetadata: parent.width - redactedLayout.width > metadataWidth + 4
|
|
||||||
|
|
||||||
RowLayout {
|
required property string eventId
|
||||||
|
|
||||||
|
contentItem: RowLayout {
|
||||||
id: redactedLayout
|
id: redactedLayout
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - 2 * Nheko.paddingMedium
|
|
||||||
spacing: Nheko.paddingSmall
|
spacing: Nheko.paddingSmall
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
@ -34,9 +30,9 @@ Rectangle{
|
||||||
id: redactedLabel
|
id: redactedLabel
|
||||||
Layout.margins: 0
|
Layout.margins: 0
|
||||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
||||||
Layout.preferredWidth: implicitWidth
|
Layout.maximumWidth: implicitWidth + 1
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
property var redactedPair: room.formatRedactedEvent(eventId)
|
property var redactedPair: room.formatRedactedEvent(msgRoot.eventId)
|
||||||
text: redactedPair["first"]
|
text: redactedPair["first"]
|
||||||
wrapMode: Label.WordWrap
|
wrapMode: Label.WordWrap
|
||||||
color: palette.text
|
color: palette.text
|
||||||
|
@ -48,4 +44,13 @@ Rectangle{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
padding: Nheko.paddingSmall
|
||||||
|
|
||||||
|
Layout.maximumWidth: redactedLayout.Layout.maximumWidth + padding * 2
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: palette.alternateBase
|
||||||
|
radius: fontMetrics.lineSpacing / 2 + 2 * Nheko.paddingSmall
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue