mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use red chats list badge for unread reactions.
This commit is contained in:
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 |
|
@ -129,6 +129,9 @@ void PaintNarrowCounter(
|
||||||
- st::dialogsUnreadHeight;
|
- st::dialogsUnreadHeight;
|
||||||
|
|
||||||
UnreadBadgeStyle st;
|
UnreadBadgeStyle st;
|
||||||
|
st.sizeId = displayMentionBadge
|
||||||
|
? UnreadBadgeInDialogs
|
||||||
|
: UnreadBadgeReactionInDialogs;
|
||||||
st.active = active;
|
st.active = active;
|
||||||
st.selected = selected;
|
st.selected = selected;
|
||||||
st.muted = mentionOrReactionMuted;
|
st.muted = mentionOrReactionMuted;
|
||||||
|
@ -221,6 +224,9 @@ int PaintWideCounter(
|
||||||
- (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2;
|
- (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2;
|
||||||
|
|
||||||
UnreadBadgeStyle st;
|
UnreadBadgeStyle st;
|
||||||
|
st.sizeId = displayMentionBadge
|
||||||
|
? UnreadBadgeInDialogs
|
||||||
|
: UnreadBadgeReactionInDialogs;
|
||||||
st.active = active;
|
st.active = active;
|
||||||
st.selected = selected;
|
st.selected = selected;
|
||||||
st.muted = mentionOrReactionMuted;
|
st.muted = mentionOrReactionMuted;
|
||||||
|
@ -618,6 +624,14 @@ public:
|
||||||
st::dialogsUnreadBgMutedOver,
|
st::dialogsUnreadBgMutedOver,
|
||||||
st::dialogsUnreadBgMutedActive
|
st::dialogsUnreadBgMutedActive
|
||||||
};
|
};
|
||||||
|
style::color reactionBg[6] = {
|
||||||
|
st::dialogsDraftFg,
|
||||||
|
st::dialogsDraftFgOver,
|
||||||
|
st::dialogsDraftFgActive,
|
||||||
|
st::dialogsUnreadBgMuted,
|
||||||
|
st::dialogsUnreadBgMutedOver,
|
||||||
|
st::dialogsUnreadBgMutedActive
|
||||||
|
};
|
||||||
rpl::lifetime lifetime;
|
rpl::lifetime lifetime;
|
||||||
};
|
};
|
||||||
Data::GlobalStructurePointer<UnreadBadgeStyleData> unreadBadgeStyle;
|
Data::GlobalStructurePointer<UnreadBadgeStyleData> unreadBadgeStyle;
|
||||||
|
@ -660,7 +674,9 @@ void PaintUnreadBadge(Painter &p, const QRect &rect, const UnreadBadgeStyle &st)
|
||||||
Assert(st.sizeId < UnreadBadgeSizesCount);
|
Assert(st.sizeId < UnreadBadgeSizesCount);
|
||||||
badgeData = &unreadBadgeStyle->sizes[st.sizeId];
|
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()) {
|
if (badgeData->left[index].isNull()) {
|
||||||
int imgsize = size * cIntRetinaFactor(), imgsizehalf = sizehalf * cIntRetinaFactor();
|
int imgsize = size * cIntRetinaFactor(), imgsizehalf = sizehalf * cIntRetinaFactor();
|
||||||
createCircleMask(badgeData, size);
|
createCircleMask(badgeData, size);
|
||||||
|
|
|
@ -68,6 +68,7 @@ enum UnreadBadgeSize {
|
||||||
UnreadBadgeInStickersPanel,
|
UnreadBadgeInStickersPanel,
|
||||||
UnreadBadgeInStickersBox,
|
UnreadBadgeInStickersBox,
|
||||||
UnreadBadgeInTouchBar,
|
UnreadBadgeInTouchBar,
|
||||||
|
UnreadBadgeReactionInDialogs,
|
||||||
|
|
||||||
UnreadBadgeSizesCount
|
UnreadBadgeSizesCount
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue