2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Fix repainting of non-first file album item.

This commit is contained in:
John Preston
2021-01-29 14:38:07 +04:00
parent fcdc39c5f9
commit fc4ed2ff91
3 changed files with 21 additions and 7 deletions

View File

@@ -1417,9 +1417,23 @@ rpl::producer<Session::IdChange> Session::itemIdChanged() const {
void Session::requestItemRepaint(not_null<const HistoryItem*> item) {
_itemRepaintRequest.fire_copy(item);
enumerateItemViews(item, [&](not_null<const ViewElement*> view) {
requestViewRepaint(view);
});
auto repaintGroupLeader = false;
auto repaintView = [&](not_null<const ViewElement*> view) {
if (view->isHiddenByGroup()) {
repaintGroupLeader = true;
} else {
requestViewRepaint(view);
}
};
enumerateItemViews(item, repaintView);
if (repaintGroupLeader) {
if (const auto group = groups().find(item)) {
const auto leader = group->items.front();
if (leader != item) {
enumerateItemViews(leader, repaintView);
}
}
}
}
rpl::producer<not_null<const HistoryItem*>> Session::itemRepaintRequest() const {