Page MenuHomePhorge

D150.1732754922.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D150.1732754922.diff

diff --git a/src/contents/ui/event-types/Video.qml b/src/contents/ui/event-types/Video.qml
--- a/src/contents/ui/event-types/Video.qml
+++ b/src/contents/ui/event-types/Video.qml
@@ -36,6 +36,14 @@
property var jobManager: kazvIOManager
property var mtxSdk: matrixSdk
+ summaryItem: Label {
+ objectName: 'summaryLabel'
+ Layout.alignment: Qt.AlignLeft
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ text: l10n.get('event-summary-video-sent', { gender, body })
+ }
+
Kazv.FileHandler {
id: fileHandler
eventContent: event.content
@@ -53,12 +61,15 @@
ColumnLayout {
id: layout
property var label: Kazv.SelectableText {
+ objectName: 'bodyLabel'
Layout.fillWidth: true
wrapMode: Text.Wrap
text: l10n.get('event-message-video-sent', { gender, body })
+ visible: !compactMode
}
property var video: Video {
id: video
+ objectName: 'video'
source: fileHandler.kazvIOJob ? "" : fileHandler.cachedFile
autoPlay: !hasAudio
loops: MediaPlayer.Infinite
diff --git a/src/l10n/cmn-Hans/100-ui.ftl b/src/l10n/cmn-Hans/100-ui.ftl
--- a/src/l10n/cmn-Hans/100-ui.ftl
+++ b/src/l10n/cmn-Hans/100-ui.ftl
@@ -167,6 +167,7 @@
event-summary-sticker-sent = 发送了贴纸「{ $body }」。
event-message-file-sent = 发送了文件「{ $body }」。
event-message-video-sent = 发送了视频「{ $body }」。
+event-summary-video-sent = 发送了视频「{ $body }」。
event-message-audio-sent = 发送了音频「{ $body }」。
event-message-audio-play-audio = 播放音频
event-sending = 发送中...
diff --git a/src/l10n/en/100-ui.ftl b/src/l10n/en/100-ui.ftl
--- a/src/l10n/en/100-ui.ftl
+++ b/src/l10n/en/100-ui.ftl
@@ -186,6 +186,7 @@
event-summary-sticker-sent = sent a sticker "{ $body }".
event-message-file-sent = sent a file "{ $body }".
event-message-video-sent = sent a video "{ $body }".
+event-summary-video-sent = sent a video "{ $body }".
event-message-audio-sent = sent an audio "{ $body }".
event-message-audio-play-audio = Play audio
event-sending = Sending...
diff --git a/src/tests/quick-tests/tst_EventView.qml b/src/tests/quick-tests/tst_EventView.qml
--- a/src/tests/quick-tests/tst_EventView.qml
+++ b/src/tests/quick-tests/tst_EventView.qml
@@ -168,6 +168,22 @@
formattedTime: '4:06 P.M.',
})
+ property var videoEvent: ({
+ eventId: '',
+ sender: '@foo:tusooa.xyz',
+ type: 'm.room.message',
+ stateKey: '',
+ content: {
+ msgtype: 'm.image',
+ body: 'some body',
+ info: {
+ h: Kirigami.Units.gridUnit * 10,
+ w: Kirigami.Units.gridUnit * 10,
+ }
+ },
+ formattedTime: '4:06 P.M.',
+ })
+
property var eventBySomeoneElse: ({
eventId: '',
sender: '@bar:tusooa.xyz',
@@ -442,6 +458,20 @@
sender: item.sender
}
+
+ Kazv.EventView {
+ id: eventViewVideo
+ event: item.videoEvent
+ sender: item.sender
+ }
+
+ Kazv.EventView {
+ id: eventViewVideoCompact
+ compactMode: true
+ event: item.videoEvent
+ sender: item.sender
+ }
+
Kazv.EventView {
Layout.fillWidth: true
id: eventViewEdited
@@ -663,6 +693,15 @@
verify(image.height <= Kirigami.Units.gridUnit * 5);
}
+ function test_videoEvent() {
+ verify(!findChild(eventViewVideo, 'summaryLabel').visible);
+ verify(findChild(eventViewVideo, 'bodyLabel').visible);
+ verify(findChild(eventViewVideoCompact, 'summaryLabel').visible);
+ verify(!findChild(eventViewVideoCompact, 'bodyLabel').visible);
+ const image = findChild(eventViewVideoCompact, 'mainImage');
+ verify(image.height <= Kirigami.Units.gridUnit * 5);
+ }
+
function test_history() {
{
const menuComp = findChild(eventViewText, 'bubble').menuComp;

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 4:48 PM (14 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41073
Default Alt Text
D150.1732754922.diff (3 KB)

Event Timeline