|
|
|
@ -395,7 +395,7 @@ MessageDelegate::Layout MessageDelegate::calcLayout( |
|
|
|
if (dlState == 1) { L.progressBarRect = QRect(bx, thH - 3, thW, 3); } |
|
|
|
if (dlState == 1) { L.progressBarRect = QRect(bx, thH - 3, thW, 3); } |
|
|
|
|
|
|
|
|
|
|
|
L.videoPlayBtnRect = QRect(bx + thW / 2 - 24, thH / 2 - 24, 48, 48); |
|
|
|
L.videoPlayBtnRect = QRect(bx + thW / 2 - 24, thH / 2 - 24, 48, 48); |
|
|
|
L.videoDurBadgeRect = QRect(bx + thW - 56, thH - 26, 48, 18); |
|
|
|
L.videoDurBadgeRect = QRect(bx + thW - 116, thH - 26, 108, 18); |
|
|
|
|
|
|
|
|
|
|
|
if (!L.narrow) { |
|
|
|
if (!L.narrow) { |
|
|
|
int avatarY = L.bubbleRect.bottom() - kAvatar; |
|
|
|
int avatarY = L.bubbleRect.bottom() - kAvatar; |
|
|
|
@ -1010,9 +1010,12 @@ void MessageDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio |
|
|
|
painter->drawPath(tri); |
|
|
|
painter->drawPath(tri); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* duration-бейдж */ |
|
|
|
/* бейдж: размер · длительность (m:ss) */ |
|
|
|
|
|
|
|
qint64 fsz = index.data(MsgFileSizeRole).toLongLong(); |
|
|
|
|
|
|
|
QString sizeStr = formatFileSize(fsz); |
|
|
|
QString durStr = index.data(MsgVoiceDurationRole).toString(); |
|
|
|
QString durStr = index.data(MsgVoiceDurationRole).toString(); |
|
|
|
if (!durStr.isEmpty()) { |
|
|
|
QString badge = durStr.isEmpty() ? sizeStr : sizeStr + " \xC2\xB7 " + durStr; |
|
|
|
|
|
|
|
if (!badge.isEmpty()) { |
|
|
|
QFont durFont = option.font; |
|
|
|
QFont durFont = option.font; |
|
|
|
durFont.setPointSize(durFont.pointSize() - 1); |
|
|
|
durFont.setPointSize(durFont.pointSize() - 1); |
|
|
|
painter->setFont(durFont); |
|
|
|
painter->setFont(durFont); |
|
|
|
@ -1020,7 +1023,7 @@ void MessageDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio |
|
|
|
painter->setBrush(QColor(0, 0, 0, 160)); |
|
|
|
painter->setBrush(QColor(0, 0, 0, 160)); |
|
|
|
painter->drawRoundedRect(L.videoDurBadgeRect, 5, 5); |
|
|
|
painter->drawRoundedRect(L.videoDurBadgeRect, 5, 5); |
|
|
|
painter->setPen(Qt::white); |
|
|
|
painter->setPen(Qt::white); |
|
|
|
painter->drawText(L.videoDurBadgeRect, Qt::AlignCenter, durStr); |
|
|
|
painter->drawText(L.videoDurBadgeRect, Qt::AlignCenter, badge); |
|
|
|
} |
|
|
|
} |
|
|
|
painter->restore(); |
|
|
|
painter->restore(); |
|
|
|
|
|
|
|
|
|
|
|
|