Wire desktop context-menu editing and update visible messages in place
This commit is contained in:
1 parent
2a9b5748e9
commit
1afb1010cc
2 files changed
+50
-4
No files matched your search
@@ -460,8 +460,7 @@ MessageDelegate::Layout MessageDelegate::calcLayout(
|
||||
QFont font = option.font; font.setPointSize(qMax(1, font.pointSize() - 1));
|
||||
QFont timeFont = option.font; timeFont.setPointSize(qMax(1, timeFont.pointSize() - 2));
|
||||
const int height = qMax(24, QFontMetrics(font).height() + 6), left = layout.bubbleRect.left() + kPadH;
|
||||
layout.reactionTimeText = index.data(MsgEditedRole).toBool() ? QCoreApplication::translate("ChatGui", "edited ") : QString();
|
||||
layout.reactionTimeText += index.data(MsgTimeRole).toString();
|
||||
layout.reactionTimeText = index.data(MsgTimeRole).toString();
|
||||
const int innerWidth = layout.bubbleRect.width() - 2 * kPadH;
|
||||
const int timeWidth = qMin(QFontMetrics(timeFont).horizontalAdvance(layout.reactionTimeText) + 2, qMax(0, innerWidth - height - 6));
|
||||
const int reactionsRight = layout.bubbleRect.right() - kPadH - timeWidth - 6;
|
||||
@@ -1683,8 +1682,7 @@ void MessageDelegate::drawStatusBar(QPainter* p, const Layout& layout, const QMo
|
||||
p->save();
|
||||
QFont font = option.font; font.setPointSize(qMax(1, font.pointSize() - 2)); p->setFont(font);
|
||||
p->setPen(QColor(128, 128, 128));
|
||||
QString text = index.data(MsgEditedRole).toBool() ? QCoreApplication::translate("ChatGui", "edited ") : QString();
|
||||
text += index.data(MsgTimeRole).toString();
|
||||
QString text = index.data(MsgTimeRole).toString();
|
||||
p->drawText(layout.statusRect, Qt::AlignRight | Qt::AlignVCenter, text);
|
||||
p->restore();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user