diff --git a/Telegram/SourceFiles/ui/chat/sponsored_message_bar.cpp b/Telegram/SourceFiles/ui/chat/sponsored_message_bar.cpp index 1f2fd24170..4cd3ca1df1 100644 --- a/Telegram/SourceFiles/ui/chat/sponsored_message_bar.cpp +++ b/Telegram/SourceFiles/ui/chat/sponsored_message_bar.cpp @@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/animation_value.h" #include "ui/effects/ripple_animation.h" #include "ui/image/image_prepare.h" +#include "ui/power_saving.h" #include "ui/rect.h" #include "ui/widgets/buttons.h" #include "ui/widgets/shadow.h" @@ -219,6 +220,13 @@ void FillSponsoredMessageBar( } }; }; + const auto paused = [=]() -> Fn { + if (const auto c = FindSessionController(widget)) { + using Gif = Window::GifPauseReason; + return [=] { return c->isGifPausedAtLeastFor(Gif::Any); }; + } + return [] { return false; }; + }; const auto kLinesForPhoto = 3; const auto rightPhotoSize = titleSt.font->ascent * kLinesForPhoto; const auto rightPhotoPlaceholder = titleSt.font->height * kLinesForPhoto; @@ -357,6 +365,8 @@ void FillSponsoredMessageBar( .geometry = Ui::Text::GeometryDescriptor{ .layout = std::move(lineLayout), }, + .pausedEmoji = On(PowerSaving::kEmojiChat) || paused(), + .pausedSpoiler = On(PowerSaving::kChatSpoiler) || paused(), }); state->lastPaintedContentTop = top; state->lastPaintedContentLineAmount = lastContentLineAmount;