mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Load gift themes while scrolling.
This commit is contained in:
@@ -560,6 +560,10 @@ void ChooseThemeController::updateInnerLeft(int now) {
|
||||
? (skip / 2)
|
||||
: std::clamp(now, skip, 0);
|
||||
_inner->move(clamped, 0);
|
||||
const auto visibleTill = -clamped + _content->width();
|
||||
if (_giftsFinishAt - visibleTill < _content->width()) {
|
||||
_peer->owner().cloudThemes().myGiftThemesLoadMore();
|
||||
}
|
||||
}
|
||||
|
||||
void ChooseThemeController::close() {
|
||||
@@ -734,6 +738,7 @@ void ChooseThemeController::fill(
|
||||
x += single.width() + skip;
|
||||
};
|
||||
|
||||
_giftsFinishAt = 0;
|
||||
if (const auto now = cloudThemes->themeForToken(initial)) {
|
||||
push(*now, initial);
|
||||
}
|
||||
@@ -741,6 +746,7 @@ void ChooseThemeController::fill(
|
||||
if (const auto found = cloudThemes->themeForToken(token)) {
|
||||
if (token != initial) {
|
||||
push(*found, token);
|
||||
_giftsFinishAt = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ private:
|
||||
std::optional<QPoint> _pressPosition;
|
||||
std::optional<QPoint> _dragStartPosition;
|
||||
int _dragStartInnerLeft = 0;
|
||||
int _giftsFinishAt = 0;
|
||||
bool _initialInnerLeftApplied = false;
|
||||
|
||||
rpl::variable<bool> _shouldBeShown = false;
|
||||
|
||||
Reference in New Issue
Block a user