diff --git a/Telegram/Resources/icons/chat/seen_checks.png b/Telegram/Resources/icons/chat/seen_checks.png new file mode 100644 index 000000000..c65944de1 Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_checks.png differ diff --git a/Telegram/Resources/icons/chat/seen_checks@2x.png b/Telegram/Resources/icons/chat/seen_checks@2x.png new file mode 100644 index 000000000..801e26d85 Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_checks@2x.png differ diff --git a/Telegram/Resources/icons/chat/seen_checks@3x.png b/Telegram/Resources/icons/chat/seen_checks@3x.png new file mode 100644 index 000000000..49333c294 Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_checks@3x.png differ diff --git a/Telegram/Resources/icons/chat/seen_played.png b/Telegram/Resources/icons/chat/seen_played.png new file mode 100644 index 000000000..ca24dd2a5 Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_played.png differ diff --git a/Telegram/Resources/icons/chat/seen_played@2x.png b/Telegram/Resources/icons/chat/seen_played@2x.png new file mode 100644 index 000000000..99884aae9 Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_played@2x.png differ diff --git a/Telegram/Resources/icons/chat/seen_played@3x.png b/Telegram/Resources/icons/chat/seen_played@3x.png new file mode 100644 index 000000000..cab65eb3b Binary files /dev/null and b/Telegram/Resources/icons/chat/seen_played@3x.png differ diff --git a/Telegram/SourceFiles/api/api_who_read.cpp b/Telegram/SourceFiles/api/api_who_read.cpp index b14de91af..6640dcf44 100644 --- a/Telegram/SourceFiles/api/api_who_read.cpp +++ b/Telegram/SourceFiles/api/api_who_read.cpp @@ -324,6 +324,20 @@ rpl::producer WhoRead( auto lifetime = rpl::lifetime(); const auto state = lifetime.make_state(); + state->current.type = [&] { + if (const auto media = item->media()) { + if (!media->webpage()) { + if (const auto document = media->document()) { + if (document->isVoiceMessage()) { + return Ui::WhoReadType::Listened; + } else if (document->isVideoMessage()) { + return Ui::WhoReadType::Watched; + } + } + } + } + return Ui::WhoReadType::Seen; + }(); const auto pushNext = [=] { consumer.put_next_copy(state->current); }; @@ -334,7 +348,10 @@ rpl::producer WhoRead( ) | rpl::start_with_next([=](const std::vector &peers) { if (ListUnknown(peers, item)) { state->userpics.clear(); - consumer.put_next(Ui::WhoReadContent{ .unknown = true }); + consumer.put_next(Ui::WhoReadContent{ + .type = state->current.type, + .unknown = true, + }); return; } else if (UpdateUserpics(state, item, peers)) { RegenerateParticipants(state, small, large); diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index c701a8689..5d6d2ed17 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -869,6 +869,7 @@ WhoRead { photoSize: pixels; photoSkip: pixels; nameLeft: pixels; + iconPosition: point; itemPadding: margins; } defaultWhoRead: WhoRead { @@ -882,7 +883,8 @@ defaultWhoRead: WhoRead { photoSize: 30px; photoSkip: 5px; nameLeft: 57px; - itemPadding: margins(17px, 8px, 17px, 6px); + iconPosition: point(14px, 9px); + itemPadding: margins(38px, 8px, 17px, 6px); } whoReadMenu: PopupMenu(defaultPopupMenu) { scrollPadding: margins(0px, 6px, 0px, 6px); @@ -891,3 +893,9 @@ whoReadMenu: PopupMenu(defaultPopupMenu) { separatorPadding: margins(0px, 6px, 0px, 8px); } } +whoReadChecks: icon{{ "chat/seen_checks", windowFg }}; +whoReadChecksOver: icon{{ "chat/seen_checks", windowFgOver }}; +whoReadChecksDisabled: icon{{ "chat/seen_checks", menuFgDisabled }}; +whoReadPlayed: icon{{ "chat/seen_played", windowFg }}; +whoReadPlayedOver: icon{{ "chat/seen_played", windowFgOver }}; +whoReadPlayedDisabled: icon {{ "chat/seen_played", menuFgDisabled }}; diff --git a/Telegram/SourceFiles/ui/controls/who_read_context_action.cpp b/Telegram/SourceFiles/ui/controls/who_read_context_action.cpp index 66ede3c65..d9d1a8145 100644 --- a/Telegram/SourceFiles/ui/controls/who_read_context_action.cpp +++ b/Telegram/SourceFiles/ui/controls/who_read_context_action.cpp @@ -251,11 +251,11 @@ void Action::resolveMinWidth() { width(tr::lng_context_seen_text(tr::now, lt_count, 999)), width(tr::lng_context_seen_listened(tr::now, lt_count, 999)), width(tr::lng_context_seen_watched(tr::now, lt_count, 999)) }); - const auto maxWidth = _st.itemPadding.left() + const auto maxWidth = st::defaultWhoRead.itemPadding.left() + maxIconWidth + maxTextWidth + _userpics->maxWidth() - + _st.itemPadding.right(); + + st::defaultWhoRead.itemPadding.right(); setMinWidth(maxWidth); } @@ -330,6 +330,18 @@ void Action::paint(Painter &p) { if (enabled) { paintRipple(p, 0, 0); } + const auto &icon = (_content.type == WhoReadType::Seen) + ? (!enabled + ? st::whoReadChecksDisabled + : selected + ? st::whoReadChecksOver + : st::whoReadChecks) + : (!enabled + ? st::whoReadPlayedDisabled + : selected + ? st::whoReadPlayedOver + : st::whoReadPlayed); + icon.paint(p, st::defaultWhoRead.iconPosition, width()); p.setPen(!enabled ? _st.itemFgDisabled : selected @@ -337,13 +349,13 @@ void Action::paint(Painter &p) { : _st.itemFg); _text.drawLeftElided( p, - _st.itemPadding.left(), - _st.itemPadding.top(), + st::defaultWhoRead.itemPadding.left(), + st::defaultWhoRead.itemPadding.top(), _textWidth, width()); _userpics->paint( p, - width() - _st.itemPadding.right(), + width() - st::defaultWhoRead.itemPadding.right(), (height() - st::defaultWhoRead.userpics.size) / 2, st::defaultWhoRead.userpics.size); } @@ -372,7 +384,7 @@ void Action::refreshText() { void Action::refreshDimensions() { const auto textWidth = _text.maxWidth(); - const auto &padding = _st.itemPadding; + const auto &padding = st::defaultWhoRead.itemPadding; const auto goodWidth = padding.left() + textWidth