mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Fixed unpaused custom emoji in top bar of sponsored messages.
This commit is contained in:
parent
3e13186560
commit
835fa77964
1 changed files with 10 additions and 0 deletions
|
@ -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<bool()> {
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue