diff --git a/Telegram/Resources/icons/info/edit/group_manage_reactions.png b/Telegram/Resources/icons/info/edit/group_manage_reactions.png new file mode 100644 index 000000000..14265081a Binary files /dev/null and b/Telegram/Resources/icons/info/edit/group_manage_reactions.png differ diff --git a/Telegram/Resources/icons/info/edit/group_manage_reactions@2x.png b/Telegram/Resources/icons/info/edit/group_manage_reactions@2x.png new file mode 100644 index 000000000..029743d6b Binary files /dev/null and b/Telegram/Resources/icons/info/edit/group_manage_reactions@2x.png differ diff --git a/Telegram/Resources/icons/info/edit/group_manage_reactions@3x.png b/Telegram/Resources/icons/info/edit/group_manage_reactions@3x.png new file mode 100644 index 000000000..d3f774a2c Binary files /dev/null and b/Telegram/Resources/icons/info/edit/group_manage_reactions@3x.png differ diff --git a/Telegram/SourceFiles/api/api_who_reacted.cpp b/Telegram/SourceFiles/api/api_who_reacted.cpp index 9fba60879..fba210011 100644 --- a/Telegram/SourceFiles/api/api_who_reacted.cpp +++ b/Telegram/SourceFiles/api/api_who_reacted.cpp @@ -493,7 +493,9 @@ rpl::producer 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 diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 8fd8a317b..4c8abddbc 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -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); diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index 11782e7c0..8dbfb17ad 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -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 }}; diff --git a/Telegram/SourceFiles/ui/controls/who_reacted_context_action.cpp b/Telegram/SourceFiles/ui/controls/who_reacted_context_action.cpp index fb5729bf1..d4204c204 100644 --- a/Telegram/SourceFiles/ui/controls/who_reacted_context_action.cpp +++ b/Telegram/SourceFiles/ui/controls/who_reacted_context_action.cpp @@ -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 diff --git a/Telegram/SourceFiles/ui/controls/who_reacted_context_action.h b/Telegram/SourceFiles/ui/controls/who_reacted_context_action.h index 8f35d4f56..8874f8ea7 100644 --- a/Telegram/SourceFiles/ui/controls/who_reacted_context_action.h +++ b/Telegram/SourceFiles/ui/controls/who_reacted_context_action.h @@ -40,7 +40,7 @@ enum class WhoReadType { struct WhoReadContent { std::vector participants; WhoReadType type = WhoReadType::Seen; - QString mostPopularReaction; + QString singleReaction; int fullReactionsCount = 0; bool unknown = false; };