[network/ruqola] src/widgets/room/delegate/messagelistlayout: Align the read-receipt icon with the timestamp

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c78748a7d86cc4234dd1457a5ad9684323b8e7f7 by Laurent Montel, on behalf of Till Adam.
Committed on 27/07/2026 at 06:39.
Pushed by tilladam into branch 'master'.

Align the read-receipt icon with the timestamp

The read-receipt check was positioned with its top at layout.baseLine — the
text baseline — so it rendered a full icon-height below the timestamp instead
of beside it. Anchor it to the timestamp text and centre it vertically, in all
three message styles (Normal, Compact, Cozy) which shared the same bug.

M  +3    -1    src/widgets/room/delegate/messagelistlayout/messagelistcompactlayout.cpp
M  +3    -1    src/widgets/room/delegate/messagelistlayout/messagelistcozylayout.cpp
M  +3    -1    src/widgets/room/delegate/messagelistlayout/messagelistnormallayout.cpp

https://invent.kde.org/network/ruqola/-/commit/c78748a7d86cc4234dd1457a5ad9684323b8e7f7

diff --git a/src/widgets/room/delegate/messagelistlayout/messagelistcompactlayout.cpp b/src/widgets/room/delegate/messagelistlayout/messagelistcompactlayout.cpp
index 9d9780f232..f553033026 100644
--- a/src/widgets/room/delegate/messagelistlayout/messagelistcompactlayout.cpp
+++ b/src/widgets/room/delegate/messagelistlayout/messagelistcompactlayout.cpp
@@ -172,7 +172,9 @@ MessageListLayoutBase::Layout MessageListCompactLayout::doLayout(const QStyleOpt
     layout.timeStampPos = QPoint(option.rect.width() - timeSize.width() - margin / 2, layout.baseLine);
     layout.timeStampRect = QRect(QPoint(layout.timeStampPos.x(), senderRectY), timeSize);
 
-    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, layout.baseLine, iconSize, iconSize);
+    // Center the read-receipt icon on the timestamp text; the old baseLine anchor put
+    // the icon's top at the text baseline, dropping it a full icon-height below the time.
+    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, senderRectY + (timeSize.height() - iconSize) / 2, iconSize, iconSize);
 
     generateAttachmentBlockAndUrlPreviewLayout(mDelegate, layout, message, attachmentsY, textLeft, maxWidth, option, index);
     layout.reactionsHeight = mDelegate->helperReactions()->sizeHint(index, maxWidth, option).height();
diff --git a/src/widgets/room/delegate/messagelistlayout/messagelistcozylayout.cpp b/src/widgets/room/delegate/messagelistlayout/messagelistcozylayout.cpp
index 43b41f86db..5a28715337 100644
--- a/src/widgets/room/delegate/messagelistlayout/messagelistcozylayout.cpp
+++ b/src/widgets/room/delegate/messagelistlayout/messagelistcozylayout.cpp
@@ -181,7 +181,9 @@ MessageListLayoutBase::Layout MessageListCozyLayout::doLayout(const QStyleOption
     generateAttachmentBlockAndUrlPreviewLayout(mDelegate, layout, message, attachmentsY, textLeft, maxWidth, option, index);
     layout.reactionsHeight = mDelegate->helperReactions()->sizeHint(index, maxWidth, option).height();
 
-    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, layout.baseLine, iconSize, iconSize);
+    // Center the read-receipt icon on the timestamp text; the old baseLine anchor put
+    // the icon's top at the text baseline, dropping it a full icon-height below the time.
+    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, senderRectY + (timeSize.height() - iconSize) / 2, iconSize, iconSize);
 
     // Replies
     layout.repliesY = layout.reactionsY + layout.reactionsHeight;
diff --git a/src/widgets/room/delegate/messagelistlayout/messagelistnormallayout.cpp b/src/widgets/room/delegate/messagelistlayout/messagelistnormallayout.cpp
index 6da8486a76..3a076b7799 100644
--- a/src/widgets/room/delegate/messagelistlayout/messagelistnormallayout.cpp
+++ b/src/widgets/room/delegate/messagelistlayout/messagelistnormallayout.cpp
@@ -233,7 +233,9 @@ MessageListLayoutBase::Layout MessageListNormalLayout::doLayout(const QStyleOpti
     generateAttachmentBlockAndUrlPreviewLayout(mDelegate, layout, message, attachmentsY, textLeft, maxWidth, option, index);
     layout.reactionsHeight = mDelegate->helperReactions()->sizeHint(index, maxWidth, option).height();
 
-    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, layout.baseLine, iconSize, iconSize);
+    // Center the read-receipt icon on the timestamp text; the old baseLine anchor put
+    // the icon's top at the text baseline, dropping it a full icon-height below the time.
+    layout.readReceiptIconRect = QRect(layout.timeStampRect.left() - margin - iconSize, senderRectY + (timeSize.height() - iconSize) / 2, iconSize, iconSize);
 
     // Replies
     layout.repliesY = layout.reactionsY + layout.reactionsHeight;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.