diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index 042d13674..ef2690e54 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -168,11 +168,10 @@ FieldAutocomplete::FieldAutocomplete( hide(); - connect( - _scroll, - &Ui::ScrollArea::geometryChanged, - _inner, - &Inner::onParentGeometryChanged); + _scroll->geometryChanged( + ) | rpl::start_with_next(crl::guard(_inner, [=] { + _inner->onParentGeometryChanged(); + }), lifetime()); } not_null FieldAutocomplete::controller() const { diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index c89491017..376bc5c3f 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -234,7 +234,10 @@ Widget::Widget( } }, lifetime()); - connect(_scroll, SIGNAL(geometryChanged()), _inner, SLOT(onParentGeometryChanged())); + _scroll->geometryChanged( + ) | rpl::start_with_next(crl::guard(_inner, [=] { + _inner->onParentGeometryChanged(); + }), lifetime()); connect(_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll())); session().data().chatsListChanges( diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.h b/Telegram/SourceFiles/dialogs/dialogs_widget.h index 6fbeeef55..668fa5f8e 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.h @@ -15,6 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/sender.h" #include "api/api_single_message_search.h" +#include + namespace MTP { class Error; } // namespace MTP diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp index 454468076..fe3a4063d 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp @@ -322,8 +322,10 @@ Widget::Widget( _scroll->move(0, _fixedBar->height()); _scroll->show(); - - connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); }); + _scroll->scrolls( + ) | rpl::start_with_next([=] { + onScroll(); + }, lifetime()); _whatIsThis->setClickedCallback([=] { controller->show(Box(channel->isMegagroup() diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index d2a291cca..6319dc79a 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -252,9 +252,14 @@ HistoryWidget::HistoryWidget( update(); }, lifetime()); - connect(_scroll, &Ui::ScrollArea::scrolled, [=] { + _scroll->scrolls( + ) | rpl::start_with_next([=] { handleScroll(); - }); + }, lifetime()); + _scroll->geometryChanged( + ) | rpl::start_with_next(crl::guard(_list, [=] { + _list->onParentGeometryChanged(); + }), lifetime()); _historyDown->addClickHandler([=] { historyDownClicked(); }); _unreadMentions->addClickHandler([=] { showNextUnreadMention(); }); _fieldBarCancel->addClickHandler([=] { cancelFieldAreaState(); }); @@ -2133,8 +2138,6 @@ void HistoryWidget::showHistory( updateControlsGeometry(); - connect(_scroll, SIGNAL(geometryChanged()), _list, SLOT(onParentGeometryChanged())); - if (const auto user = _peer->asUser()) { if (const auto &info = user->botInfo) { if (startBot) { diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp index 7c6d5a8dc..ddbe6d8bb 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp @@ -157,7 +157,10 @@ PinnedWidget::PinnedWidget( static_cast(this))); _scroll->move(0, _topBar->height()); _scroll->show(); - connect(_scroll.get(), &Ui::ScrollArea::scrolled, [=] { onScroll(); }); + _scroll->scrolls( + ) | rpl::start_with_next([=] { + onScroll(); + }, lifetime()); setupClearButton(); setupScrollDownButton(); diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index b6eb7039e..4dff37433 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -224,7 +224,10 @@ RepliesWidget::RepliesWidget( static_cast(this))); _scroll->move(0, _topBar->height()); _scroll->show(); - connect(_scroll.get(), &Ui::ScrollArea::scrolled, [=] { onScroll(); }); + _scroll->scrolls( + ) | rpl::start_with_next([=] { + onScroll(); + }, lifetime()); _inner->editMessageRequested( ) | rpl::start_with_next([=](auto fullId) { diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index b1cc6cc53..0b040f20a 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -155,7 +155,10 @@ ScheduledWidget::ScheduledWidget( static_cast(this))); _scroll->move(0, _topBar->height()); _scroll->show(); - connect(_scroll, &Ui::ScrollArea::scrolled, [=] { onScroll(); }); + _scroll->scrolls( + ) | rpl::start_with_next([=] { + onScroll(); + }, lifetime()); _inner->editMessageRequested( ) | rpl::start_with_next([=](auto fullId) { diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp index f0dc5f129..d9d4123ca 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp @@ -48,11 +48,10 @@ Widget::Widget( _inner->moveToLeft(0, 0, _scroll->width()); - connect( - _scroll, - &Ui::ScrollArea::scrolled, - this, - &InlineBots::Layout::Widget::onScroll); + _scroll->scrolls( + ) | rpl::start_with_next([=] { + onScroll(); + }, lifetime()); _inner->inlineRowsCleared( ) | rpl::start_with_next([=] { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index a827d9436..7182fad08 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit a827d9436e9ca258dfdfb9b67ef1ad917c13c5b5 +Subproject commit 7182fad08a004b86697af27c971c16bb12c8b421