mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 16:45:12 +00:00
Added ability to unload not visible GIFs as heavy parts in overview.
This commit is contained in:
@@ -1895,7 +1895,8 @@ void Gif::clipCallback(Media::Clip::Notification notification) {
|
||||
height,
|
||||
ImageRoundRadius::None, RectPart::None);
|
||||
}
|
||||
} else if (_gif->autoPausedGif()/* && !context()->inlineItemVisible(this)*/) {
|
||||
} else if (_gif->autoPausedGif()
|
||||
&& !delegate()->itemVisible(this)) {
|
||||
clearHeavyPart();
|
||||
}
|
||||
}
|
||||
@@ -2057,9 +2058,17 @@ void Gif::ensureDataMediaCreated() const {
|
||||
}
|
||||
|
||||
void Gif::clearHeavyPart() {
|
||||
_gif.reset();
|
||||
_dataMedia = nullptr;
|
||||
}
|
||||
|
||||
void Gif::setPosition(int32 position) {
|
||||
ItemBase::setPosition(position);
|
||||
if (position < 0) {
|
||||
_gif.reset();
|
||||
}
|
||||
}
|
||||
|
||||
float64 Gif::dataProgress() const {
|
||||
ensureDataMediaCreated();
|
||||
return _dataMedia->progress();
|
||||
|
Reference in New Issue
Block a user