File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Telegram/SourceFiles/ui/chat Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,10 @@ void ChooseThemeController::updateInnerLeft(int now) {
560560 ? (skip / 2 )
561561 : std::clamp (now, skip, 0 );
562562 _inner->move (clamped, 0 );
563+ const auto visibleTill = -clamped + _content->width ();
564+ if (_giftsFinishAt - visibleTill < _content->width ()) {
565+ _peer->owner ().cloudThemes ().myGiftThemesLoadMore ();
566+ }
563567}
564568
565569void ChooseThemeController::close () {
@@ -734,13 +738,15 @@ void ChooseThemeController::fill(
734738 x += single.width () + skip;
735739 };
736740
741+ _giftsFinishAt = 0 ;
737742 if (const auto now = cloudThemes->themeForToken (initial)) {
738743 push (*now, initial);
739744 }
740745 for (const auto &token : cloudThemes->myGiftThemesTokens ()) {
741746 if (const auto found = cloudThemes->themeForToken (token)) {
742747 if (token != initial) {
743748 push (*found, token);
749+ _giftsFinishAt = x;
744750 }
745751 }
746752 }
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ class ChooseThemeController final {
7373 std::optional<QPoint> _pressPosition;
7474 std::optional<QPoint> _dragStartPosition;
7575 int _dragStartInnerLeft = 0 ;
76+ int _giftsFinishAt = 0 ;
7677 bool _initialInnerLeftApplied = false ;
7778
7879 rpl::variable<bool > _shouldBeShown = false ;
You can’t perform that action at this time.
0 commit comments