mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Use reactions icon in context menu if more than 1 reaction type.
This commit is contained in:
parent
3623fb1f9a
commit
1ab0f840f3
8 changed files with 16 additions and 5 deletions
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions.png
Normal file
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,016 B |
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions@2x.png
Normal file
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions@3x.png
Normal file
BIN
Telegram/Resources/icons/info/edit/group_manage_reactions@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 }};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue