2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Show small unread mark for non-opened topics.

This commit is contained in:
John Preston
2022-11-15 19:49:14 +04:00
parent ce631436bf
commit bb106b07af
3 changed files with 29 additions and 1 deletions

View File

@@ -112,7 +112,32 @@ int PaintBadges(
bool displayPinnedIcon = false,
int pinnedIconTop = 0) {
auto initial = right;
if (badgesState.unread) {
if (badgesState.unread
&& !badgesState.unreadCounter
&& context.st->unreadMarkDiameter > 0) {
const auto d = context.st->unreadMarkDiameter;
UnreadBadgeStyle st;
PainterHighQualityEnabler hq(p);
const auto rect = QRect(
right - st.size + (st.size - d) / 2,
top + (st.size - d) / 2,
d,
d);
p.setPen(Qt::NoPen);
p.setBrush(badgesState.unreadMuted
? (context.active
? st::dialogsUnreadBgMutedActive
: context.selected
? st::dialogsUnreadBgMutedOver
: st::dialogsUnreadBgMuted)
: (context.active
? st::dialogsUnreadBgActive
: context.selected
? st::dialogsUnreadBgOver
: st::dialogsUnreadBg));
p.drawEllipse(rect);
right -= st.size + st.padding;
} else if (badgesState.unread) {
UnreadBadgeStyle st;
st.active = context.active;
st.selected = context.selected;