Page MenuHomePhorge

D219.1749250517.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D219.1749250517.diff

diff --git a/src/contents/ui/RoomPage.qml b/src/contents/ui/RoomPage.qml
--- a/src/contents/ui/RoomPage.qml
+++ b/src/contents/ui/RoomPage.qml
@@ -34,6 +34,7 @@
signal viewEventHistoryRequested(string eventId)
title: roomNameProvider.name
+ padding: 0
property var isInvite: room.membership === MK.MatrixRoom.Invite
property var isJoin: room.membership === MK.MatrixRoom.Join
diff --git a/src/contents/ui/RoomTimelineView.qml b/src/contents/ui/RoomTimelineView.qml
--- a/src/contents/ui/RoomTimelineView.qml
+++ b/src/contents/ui/RoomTimelineView.qml
@@ -180,4 +180,24 @@
const index = timeline.indexOfEvent(eventId);
positionViewAtIndex(index, ListView.Center);
}
+
+ Kirigami.Action {
+ id: scrollToLatestAction
+ icon.name: "go-down"
+ text: l10n.get("room-timeline-scroll-to-latest-action")
+ onTriggered: {
+ roomTimelineView.positionViewAtBeginning();
+ }
+ }
+
+ Button {
+ objectName: 'scrollToLatestButton'
+ visible: !roomTimelineView.atYEnd
+ anchors {
+ right: roomTimelineView.right
+ bottom: roomTimelineView.bottom
+ }
+ action: scrollToLatestAction
+ display: AbstractButton.IconOnly
+ }
}
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
@@ -159,6 +159,7 @@
sticker-picker-room-default-sticker-pack-name = {$room} 中的默认包
room-timeline-load-more-action = 加载更多
+room-timeline-scroll-to-latest-action = 滚动到最新的消息
room-invite-accept-action = 接受邀请
room-invite-reject-action = 拒绝邀请
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
@@ -163,6 +163,7 @@
sticker-picker-room-default-sticker-pack-name = Default pack in {$room}
room-timeline-load-more-action = Load more
+room-timeline-scroll-to-latest-action = Scroll to latest message
room-invite-accept-action = Accept invite
room-invite-reject-action = Reject invite
diff --git a/src/tests/quick-tests/tst_RoomTimelineView.qml b/src/tests/quick-tests/tst_RoomTimelineView.qml
--- a/src/tests/quick-tests/tst_RoomTimelineView.qml
+++ b/src/tests/quick-tests/tst_RoomTimelineView.qml
@@ -190,5 +190,19 @@
tryVerify(() => !popup.opened);
tryVerify(() => !findChild(Overlay.overlay, 'confirmDeletionPopup'));
}
+
+ function test_scrollToLatestButton() {
+ while (item.height > roomTimelineView.contentHeight) {
+ timeline.append({});
+ roomTimelineView.forceLayout();
+ }
+ const scrollToLatestBtn = findChild(roomTimelineView, 'scrollToLatestButton');
+ verify(!scrollToLatestBtn.visible);
+ roomTimelineView.positionViewAtEnd();
+ verify(scrollToLatestBtn.visible);
+ mouseClick(scrollToLatestBtn);
+ verify(roomTimelineView.atYEnd);
+ verify(!scrollToLatestBtn.visible);
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Jun 6, 3:55 PM (1 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
204931
Default Alt Text
D219.1749250517.diff (2 KB)

Event Timeline