From 7bb2f590c7f482d64412fedc40fcdaa0e4fd33c8 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 20 Mar 2026 08:37:39 +0300 Subject: [PATCH] [poll-view] Added small video play icon overlay to poll answers. --- .../history/view/media/history_view_poll.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index cd7b7dac3b..4bc4f196d5 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -55,6 +55,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_session_controller.h" #include "styles/style_chat.h" #include "styles/style_chat_helpers.h" +#include "styles/style_dialogs.h" #include "styles/style_widgets.h" #include "styles/style_window.h" @@ -178,6 +179,7 @@ struct PollThumbnailData { ClickHandlerPtr handler; PollThumbnailKind kind = PollThumbnailKind::None; bool rounded = false; + bool isVideo = false; uint64 id = 0; }; @@ -214,6 +216,9 @@ struct PollThumbnailData { messageContext.id); result.rounded = true; result.kind = PollThumbnailKind::Document; + result.isVideo = media.document->isVideoFile() + || media.document->isVideoMessage() + || media.document->isAnimation(); } } if (result.kind == PollThumbnailKind::Photo && result.id) { @@ -335,6 +340,7 @@ struct Poll::Answer { Ui::Animations::Simple selectedAnimation; std::shared_ptr thumbnail; bool thumbnailRounded = false; + bool thumbnailIsVideo = false; PollThumbnailKind thumbnailKind = PollThumbnailKind::None; uint64 thumbnailId = 0; mutable std::unique_ptr ripple; @@ -424,6 +430,7 @@ void Poll::Answer::fillMedia( thumbnail = updated.thumbnail; mediaHandler = updated.handler; thumbnailRounded = updated.rounded; + thumbnailIsVideo = updated.isVideo; thumbnailKind = updated.kind; thumbnailId = updated.id; if (thumbnail) { @@ -2087,6 +2094,9 @@ int Poll::paintAnswer( } p.drawImage(geometry, image, source); p.restore(); + if (answer.thumbnailIsVideo) { + st::dialogsMiniPlay.paintInCenter(p, target); + } } } }