Moved peer list rows scroll cache to separate module.

This commit is contained in:
23rd
2026-07-02 12:32:02 +03:00
parent 9766019a58
commit 7c2725ff73
4 changed files with 17 additions and 10 deletions
@@ -0,0 +1,36 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/rows_scroll_cache.h"
namespace Ui {
namespace {
constexpr auto kStopTimeout = crl::time(120);
} // namespace
RowsScrollCache::RowsScrollCache(Fn<void()> stopped) {
_stopTimer.setCallback([=] {
_scrolling = false;
_images.clear();
stopped();
});
}
void RowsScrollCache::markScrolling() {
_scrolling = true;
_stopTimer.callOnce(kStopTimeout);
}
void RowsScrollCache::invalidate(uint64 rowId) {
if (const auto i = _images.find(rowId); i != end(_images)) {
_images.erase(i);
}
}
} // namespace Ui