Use red chats list badge for unread reactions.

This commit is contained in:
John Preston 2022-02-13 19:18:29 +03:00
parent 6daa267329
commit d15af0c5f0
5 changed files with 18 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 787 B

View File

@ -129,6 +129,9 @@ void PaintNarrowCounter(
- st::dialogsUnreadHeight;
UnreadBadgeStyle st;
st.sizeId = displayMentionBadge
? UnreadBadgeInDialogs
: UnreadBadgeReactionInDialogs;
st.active = active;
st.selected = selected;
st.muted = mentionOrReactionMuted;
@ -221,6 +224,9 @@ int PaintWideCounter(
- (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2;
UnreadBadgeStyle st;
st.sizeId = displayMentionBadge
? UnreadBadgeInDialogs
: UnreadBadgeReactionInDialogs;
st.active = active;
st.selected = selected;
st.muted = mentionOrReactionMuted;
@ -618,6 +624,14 @@ public:
st::dialogsUnreadBgMutedOver,
st::dialogsUnreadBgMutedActive
};
style::color reactionBg[6] = {
st::dialogsDraftFg,
st::dialogsDraftFgOver,
st::dialogsDraftFgActive,
st::dialogsUnreadBgMuted,
st::dialogsUnreadBgMutedOver,
st::dialogsUnreadBgMutedActive
};
rpl::lifetime lifetime;
};
Data::GlobalStructurePointer<UnreadBadgeStyleData> unreadBadgeStyle;
@ -660,7 +674,9 @@ void PaintUnreadBadge(Painter &p, const QRect &rect, const UnreadBadgeStyle &st)
Assert(st.sizeId < UnreadBadgeSizesCount);
badgeData = &unreadBadgeStyle->sizes[st.sizeId];
}
auto bg = unreadBadgeStyle->bg[index];
auto bg = (st.sizeId == UnreadBadgeReactionInDialogs)
? unreadBadgeStyle->reactionBg[index]
: unreadBadgeStyle->bg[index];
if (badgeData->left[index].isNull()) {
int imgsize = size * cIntRetinaFactor(), imgsizehalf = sizehalf * cIntRetinaFactor();
createCircleMask(badgeData, size);

View File

@ -68,6 +68,7 @@ enum UnreadBadgeSize {
UnreadBadgeInStickersPanel,
UnreadBadgeInStickersBox,
UnreadBadgeInTouchBar,
UnreadBadgeReactionInDialogs,
UnreadBadgeSizesCount
};