Invalidate chats list online mark on palette change.

This commit is contained in:
John Preston 2023-03-17 16:09:23 +04:00
parent 9c91b03a5b
commit 2928c7b4b5
2 changed files with 8 additions and 3 deletions

View File

@ -431,15 +431,19 @@ void Row::paintUserpic(
auto key = peer->userpicUniqueKey(userpicView());
key.first += peer->messagesTTL();
const auto frameIndex = videoUserpic ? videoUserpic->frameIndex() : -1;
if (_cornerBadgeUserpic->key != key) {
const auto paletteVersion = style::PaletteVersion();
const auto keyChanged = (_cornerBadgeUserpic->key != key)
|| (_cornerBadgeUserpic->paletteVersion != paletteVersion);
if (keyChanged) {
_cornerBadgeUserpic->cacheTTL = QImage();
}
if (!_cornerBadgeUserpic->layersManager.isFinished()
|| _cornerBadgeUserpic->key != key
if (keyChanged
|| !_cornerBadgeUserpic->layersManager.isFinished()
|| _cornerBadgeUserpic->active != context.active
|| _cornerBadgeUserpic->frameIndex != frameIndex
|| videoUserpic) {
_cornerBadgeUserpic->key = key;
_cornerBadgeUserpic->paletteVersion = paletteVersion;
_cornerBadgeUserpic->active = context.active;
_cornerBadgeUserpic->frameIndex = frameIndex;
_cornerBadgeUserpic->layersManager.markFrameShown();

View File

@ -167,6 +167,7 @@ private:
struct CornerBadgeUserpic {
InMemoryKey key;
CornerLayersManager layersManager;
int paletteVersion = 0;
int frameIndex = -1;
bool active = false;
QImage frame;