Use reactions icon in context menu if more than 1 reaction type.

This commit is contained in:
John Preston 2021-12-30 16:07:52 +03:00
parent 3623fb1f9a
commit 1ab0f840f3
8 changed files with 16 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -493,7 +493,9 @@ rpl::producer<Ui::WhoReadContent> WhoReacted(
[](const auto &pair) { return pair.second; });
// #TODO reactions
state->current.mostPopularReaction = item->reactions().front().first;
state->current.singleReaction = (list.size() == 1)
? list.front().first
: QString();
}
std::move(
idsWithReactions

View File

@ -362,7 +362,7 @@ infoIconAdministrators: icon {{ "info/edit/group_manage_admins", infoIconFg, poi
infoIconBlacklist: icon {{ "info_blacklist", infoIconFg, point(-2px, -2px) }};
infoIconPermissions: icon {{ "info/edit/group_manage_permissions", infoIconFg, point(0px, -2px) }};
infoIconInviteLinks: icon {{ "info/edit/group_manage_links", infoIconFg, point(-2px, 0px) }};
infoIconReactions: icon {{ "menu/read_reactions", infoIconFg, point(2px, 4px) }};
infoIconReactions: icon {{ "info/edit/group_manage_reactions", infoIconFg, point(2px, 4px) }};
infoInformationIconPosition: point(25px, 12px);
infoNotificationsIconPosition: point(20px, 5px);
infoSharedMediaIconPosition: point(20px, 24px);

View File

@ -920,6 +920,9 @@ whoReadChecksDisabled: icon{{ "menu/read_ticks", menuFgDisabled }};
whoReadPlayed: icon{{ "menu/read_audio", menuSubmenuArrowFg }};
whoReadPlayedOver: icon{{ "menu/read_audio", menuSubmenuArrowFg }};
whoReadPlayedDisabled: icon {{ "menu/read_audio", menuFgDisabled }};
whoReadReactions: icon{{ "menu/read_reactions", menuSubmenuArrowFg }};
whoReadReactionsOver: icon{{ "menu/read_reactions", menuSubmenuArrowFg }};
whoReadReactionsDisabled: icon{{ "menu/read_reactions", menuFgDisabled }};
reactionsTabAll: icon {{ "menu/read_reactions", windowFg }};
reactionsTabAllSelected: icon {{ "menu/read_reactions", activeButtonFg }};

View File

@ -400,7 +400,7 @@ void Action::paint(Painter &p) {
if (enabled) {
paintRipple(p, 0, 0);
}
if (const auto emoji = Emoji::Find(_content.mostPopularReaction)) {
if (const auto emoji = Emoji::Find(_content.singleReaction)) {
// #TODO reactions
const auto ratio = style::DevicePixelRatio();
const auto size = Emoji::GetSizeNormal();
@ -409,7 +409,13 @@ void Action::paint(Painter &p) {
const auto y = (_height - (size / ratio)) / 2;
Emoji::Draw(p, emoji, size, x, y);
} else {
const auto &icon = (_content.type == WhoReadType::Seen)
const auto &icon = (_content.fullReactionsCount)
? (!enabled
? st::whoReadReactionsDisabled
: selected
? st::whoReadReactionsOver
: st::whoReadReactions)
: (_content.type == WhoReadType::Seen)
? (!enabled
? st::whoReadChecksDisabled
: selected

View File

@ -40,7 +40,7 @@ enum class WhoReadType {
struct WhoReadContent {
std::vector<WhoReadParticipant> participants;
WhoReadType type = WhoReadType::Seen;
QString mostPopularReaction;
QString singleReaction;
int fullReactionsCount = 0;
bool unknown = false;
};