mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Moved unread voice dot indicator next to media label in dialog list.
Related commit: 9febcd88d4.
This commit is contained in:
@@ -4509,6 +4509,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_in_dlg_audio_file" = "Audio file";
|
||||
"lng_in_dlg_contact" = "Contact";
|
||||
"lng_in_dlg_audio" = "Voice message";
|
||||
"lng_in_dlg_audio_unread" = "{emoji} Voice message";
|
||||
"lng_in_dlg_video_message" = "Video message";
|
||||
"lng_in_dlg_voice_message_ttl" = "One-time Voice Message";
|
||||
"lng_in_dlg_video_message_ttl" = "One-time Video Message";
|
||||
|
||||
@@ -1222,6 +1222,11 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const {
|
||||
} else if (_document->isVoiceMessage()) {
|
||||
return (item->media() && item->media()->ttlSeconds())
|
||||
? tr::lng_in_dlg_voice_message_ttl(tr::now)
|
||||
: item->isUnreadMedia()
|
||||
? tr::lng_in_dlg_audio_unread(
|
||||
tr::now,
|
||||
lt_emoji,
|
||||
QChar(0x25CF))
|
||||
: tr::lng_in_dlg_audio(tr::now);
|
||||
} else if (const auto name = FormatSongNameFor(_document).string();
|
||||
!name.isEmpty()) {
|
||||
|
||||
@@ -540,10 +540,6 @@ dialogsScamFont: font(9px semibold);
|
||||
dialogsScamSkip: 4px;
|
||||
dialogsScamRadius: 2px;
|
||||
|
||||
dialogsUnreadMediaSize: 5px;
|
||||
dialogsUnreadMediaSkip: 4px;
|
||||
dialogsUnreadMediaTop: 7px;
|
||||
|
||||
dialogsMiniPreviewTop: 1px;
|
||||
dialogsMiniPreview: 16px;
|
||||
dialogsMiniPreviewRadius: 2px;
|
||||
|
||||
@@ -382,9 +382,6 @@ int MessageView::countWidth() const {
|
||||
* (st::dialogsMiniPreview + st::dialogsMiniPreviewSkip))
|
||||
+ st::dialogsMiniPreviewRight;
|
||||
}
|
||||
if (_unreadMedia) {
|
||||
result += st::dialogsUnreadMediaSize + st::dialogsUnreadMediaSkip;
|
||||
}
|
||||
return result + _textCache.maxWidth();
|
||||
}
|
||||
|
||||
@@ -508,31 +505,6 @@ void MessageView::paint(
|
||||
rect.setLeft(rect.x() + st::dialogsMiniPreviewRight);
|
||||
}
|
||||
// Style of _textCache.
|
||||
if (_unreadMedia && rect.width()
|
||||
>= st::dialogsUnreadMediaSize + st::dialogsUnreadMediaSkip) {
|
||||
{
|
||||
PainterHighQualityEnabler hq(p);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(context.active
|
||||
? st::dialogsTextFgServiceActive
|
||||
: context.selected
|
||||
? st::dialogsTextFgServiceOver
|
||||
: st::dialogsTextFgService);
|
||||
p.drawEllipse(
|
||||
rect.x(),
|
||||
rect.y() + st::dialogsUnreadMediaTop,
|
||||
st::dialogsUnreadMediaSize,
|
||||
st::dialogsUnreadMediaSize);
|
||||
}
|
||||
p.setPen(context.active
|
||||
? st::dialogsTextFgActive
|
||||
: context.selected
|
||||
? st::dialogsTextFgOver
|
||||
: st::dialogsTextFg);
|
||||
rect.setLeft(rect.x()
|
||||
+ st::dialogsUnreadMediaSize
|
||||
+ st::dialogsUnreadMediaSkip);
|
||||
}
|
||||
static const auto ellipsisWidth = st::dialogsTextStyle.font->width(
|
||||
kQEllipsis);
|
||||
if (rect.width() > ellipsisWidth) {
|
||||
|
||||
Reference in New Issue
Block a user