Fix scrolling expanded frequent contacts.

This commit is contained in:
John Preston 2024-05-04 14:36:26 +04:00
parent 7289292f02
commit 129d356909
3 changed files with 12 additions and 0 deletions

View File

@ -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);
}

View File

@ -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()

View File

@ -62,6 +62,9 @@ public:
void deselectByKeyboard();
bool chooseRow();
[[nodiscard]] auto verticalScrollEvents() const
-> rpl::producer<not_null<QWheelEvent*>>;
private:
struct Entry;
struct Layout;