2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

inline gifs playback / stopping done

This commit is contained in:
John Preston
2015-12-23 19:48:44 +03:00
parent 9a72293e0a
commit 6170144fe9
17 changed files with 143 additions and 42 deletions

View File

@@ -147,9 +147,28 @@ namespace Notify {
if (it != items.cend()) {
HistoryItem *item = it.value();
item->initDimensions(); // can delete reader and items entry it
Notify::historyItemResized(item, true);
Notify::historyItemLayoutChanged(item);
bool stopped = false;
if (reader->paused()) {
if (MainWidget *m = App::main()) {
if (!m->isItemVisible(item)) { // stop animation if it is not visible
if (HistoryMedia *media = item->getMedia()) {
media->stopInline(item);
if (DocumentData *document = media->getDocument()) { // forget data from memory
if (!document->data.isEmpty()) {
document->data.clear();
document->prepareAutoLoader();
}
}
stopped = true;
}
}
}
}
if (!stopped) {
item->initDimensions(); // can delete reader and items entry it
Notify::historyItemResized(item);
Notify::historyItemLayoutChanged(item);
}
}
if (Window *w = App::wnd()) w->notify_clipReinit(reader);
}