2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Save frame in GIFs panel.

This commit is contained in:
John Preston
2020-05-22 13:58:46 +04:00
parent 7d386b164b
commit c967a72dcb
6 changed files with 45 additions and 40 deletions

View File

@@ -292,24 +292,26 @@ void Inner::clearSelection() {
update();
}
void Inner::hideFinish(bool completely) {
if (completely) {
const auto unload = [](const auto &item) {
if (const auto document = item->getDocument()) {
document->unload();
}
if (const auto photo = item->getPhoto()) {
photo->unload();
}
if (const auto result = item->getResult()) {
result->unload();
}
item->unloadHeavyPart();
};
clearInlineRows(false);
for (const auto &[result, layout] : _inlineLayouts) {
unload(layout);
void Inner::hideFinished() {
clearHeavyData();
}
void Inner::clearHeavyData() {
const auto unload = [](const auto &item) {
if (const auto document = item->getDocument()) {
document->unload();
}
if (const auto photo = item->getPhoto()) {
photo->unload();
}
if (const auto result = item->getResult()) {
result->unload();
}
item->unloadHeavyPart();
};
clearInlineRows(false);
for (const auto &[result, layout] : _inlineLayouts) {
unload(layout);
}
}
@@ -964,7 +966,7 @@ void Widget::hideFinished() {
_controller->disableGifPauseReason(
Window::GifPauseReason::InlineResults);
_inner->hideFinish(true);
_inner->hideFinished();
_a_show.stop();
_showAnimation.reset();
_cache = QPixmap();