Skip to content

Commit

Permalink
Fix scrolling expanded frequent contacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed May 4, 2024
1 parent 7289292 commit 129d356
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,11 @@ void Suggestions::setupChats() {
_chatsScroll->scrollToY(request.ymin, request.ymax);
}, _topPeers->lifetime());

_topPeers->verticalScrollEvents(
) | rpl::start_with_next([=](not_null<QWheelEvent*> e) {
_chatsScroll->viewportEvent(e);
}, _topPeers->lifetime());

_chatsScroll->setVisible(_tab.current() == Tab::Chats);
}

Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/dialogs/ui/top_peers_strip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ int TopPeersStrip::resizeGetHeight(int newWidth) {
return _strip.y() + _strip.height();
}

rpl::producer<not_null<QWheelEvent*>> TopPeersStrip::verticalScrollEvents() const {
return _verticalScrollEvents.events();
}

void TopPeersStrip::stripWheelEvent(QWheelEvent *e) {
const auto phase = e->phase();
const auto fullDelta = e->pixelDelta().isNull()
Expand Down
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/dialogs/ui/top_peers_strip.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class TopPeersStrip final : public Ui::RpWidget {
void deselectByKeyboard();
bool chooseRow();

[[nodiscard]] auto verticalScrollEvents() const
-> rpl::producer<not_null<QWheelEvent*>>;

private:
struct Entry;
struct Layout;
Expand Down

0 comments on commit 129d356

Please sign in to comment.