summary refs log tree commit diff
path: root/resources/qml/TimelineDefaultMessageStyle.qml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/qml/TimelineDefaultMessageStyle.qml')
-rw-r--r--resources/qml/TimelineDefaultMessageStyle.qml82
1 files changed, 12 insertions, 70 deletions
diff --git a/resources/qml/TimelineDefaultMessageStyle.qml b/resources/qml/TimelineDefaultMessageStyle.qml
index 8beaa8f0..f4906208 100644
--- a/resources/qml/TimelineDefaultMessageStyle.qml
+++ b/resources/qml/TimelineDefaultMessageStyle.qml
@@ -51,7 +51,7 @@ TimelineEvent {
     property alias hovered: messageHover.hovered
     property bool scrolledToThis: false
 
-    mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0) + 4
+    mainInset: (threadId ? (4 + Nheko.paddingSmall) : 0)
     replyInset: mainInset + 4 + Nheko.paddingSmall
 
     maxWidth: chat.delegateMaxWidth - avatarMargin - metadata.width
@@ -269,82 +269,24 @@ TimelineEvent {
             }
 
         },
-            RowLayout {
+            TimelineMetadata {
                 id: metadata
 
-                property int iconSize: Math.floor(fontMetrics.ascent * scaling)
-                property double scaling: Settings.bubbles ? 0.75 : 1
+                scaling: 1
 
                 anchors.right: parent.right
                 y: section.visible && section.active ? section.y + section.height : 0
 
-                spacing: 2
-                visible: !isStateEvent
+                visible: !wrapper.isStateEvent
 
-                StatusIndicator {
-                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
-                    eventId: wrapper.eventId
-                    height: parent.iconSize
-                    status: wrapper.status
-                    width: parent.iconSize
-                }
-                Image {
-                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
-                    ToolTip.delay: Nheko.tooltipDelay
-                    ToolTip.text: qsTr("Edited")
-                    ToolTip.visible: editHovered.hovered
-                    height: parent.iconSize
-                    source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((wrapper.eventId == wrapper.room.edit) ? palette.highlight : palette.buttonText)
-                    sourceSize.height: parent.iconSize * Screen.devicePixelRatio
-                    sourceSize.width: parent.iconSize * Screen.devicePixelRatio
-                    visible: wrapper.isEdited || wrapper.eventId == wrapper.room.edit
-                    width: parent.iconSize
-
-                    HoverHandler {
-                        id: editHovered
-
-                    }
-                }
-                ImageButton {
-                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
-                    ToolTip.delay: Nheko.tooltipDelay
-                    ToolTip.text: qsTr("Part of a thread")
-                    ToolTip.visible: hovered
-                    buttonTextColor: TimelineManager.userColor(wrapper.threadId, palette.base)
-                    height: parent.iconSize
-                    image: ":/icons/icons/ui/thread.svg"
-                    visible: wrapper.threadId
-                    width: parent.iconSize
-
-                    onClicked: wrapper.room.thread = threadId
-                }
-                EncryptionIndicator {
-                    Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
-                    encrypted: wrapper.isEncrypted
-                    height: parent.iconSize
-                    sourceSize.height: parent.iconSize * Screen.devicePixelRatio
-                    sourceSize.width: parent.iconSize * Screen.devicePixelRatio
-                    trust: wrapper.trustlevel
-                    visible: wrapper.room.isEncrypted
-                    width: parent.iconSize
-                }
-                Label {
-                    id: ts
-
-                    Layout.alignment: Qt.AlignRight | Qt.AlignTop
-                    Layout.preferredWidth: implicitWidth
-                    ToolTip.delay: Nheko.tooltipDelay
-                    ToolTip.text: Qt.formatDateTime(wrapper.timestamp, Qt.DefaultLocaleLongDate)
-                    ToolTip.visible: ma.hovered
-                    color: palette.inactive.text
-                    font.pointSize: fontMetrics.font.pointSize * parent.scaling
-                    text: wrapper.timestamp.toLocaleTimeString(Locale.ShortFormat)
-
-                    HoverHandler {
-                        id: ma
-
-                    }
-                }
+                eventId: wrapper.eventId
+                status: wrapper.status
+                trustlevel: wrapper.trustlevel
+                isEdited: wrapper.isEdited
+                isEncrypted: wrapper.isEncrypted
+                threadId: wrapper.threadId
+                timestamp: wrapper.timestamp
+                room: wrapper.room
             },
         Reactions {
             id: reactionRow