Removed Q_OBJECT from ScrollArea.

This commit is contained in:
23rd 2021-09-29 19:01:12 +03:00
parent e3ef7d6631
commit cb8f49aea0
10 changed files with 38 additions and 21 deletions

View File

@ -168,11 +168,10 @@ FieldAutocomplete::FieldAutocomplete(
hide(); hide();
connect( _scroll->geometryChanged(
_scroll, ) | rpl::start_with_next(crl::guard(_inner, [=] {
&Ui::ScrollArea::geometryChanged, _inner->onParentGeometryChanged();
_inner, }), lifetime());
&Inner::onParentGeometryChanged);
} }
not_null<Window::SessionController*> FieldAutocomplete::controller() const { not_null<Window::SessionController*> FieldAutocomplete::controller() const {

View File

@ -234,7 +234,10 @@ Widget::Widget(
} }
}, lifetime()); }, 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())); connect(_scroll, SIGNAL(scrolled()), this, SLOT(onListScroll()));
session().data().chatsListChanges( session().data().chatsListChanges(

View File

@ -15,6 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/sender.h" #include "mtproto/sender.h"
#include "api/api_single_message_search.h" #include "api/api_single_message_search.h"
#include <QtCore/QTimer>
namespace MTP { namespace MTP {
class Error; class Error;
} // namespace MTP } // namespace MTP

View File

@ -322,8 +322,10 @@ Widget::Widget(
_scroll->move(0, _fixedBar->height()); _scroll->move(0, _fixedBar->height());
_scroll->show(); _scroll->show();
_scroll->scrolls(
connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); }); ) | rpl::start_with_next([=] {
onScroll();
}, lifetime());
_whatIsThis->setClickedCallback([=] { _whatIsThis->setClickedCallback([=] {
controller->show(Box<InformBox>(channel->isMegagroup() controller->show(Box<InformBox>(channel->isMegagroup()

View File

@ -252,9 +252,14 @@ HistoryWidget::HistoryWidget(
update(); update();
}, lifetime()); }, lifetime());
connect(_scroll, &Ui::ScrollArea::scrolled, [=] { _scroll->scrolls(
) | rpl::start_with_next([=] {
handleScroll(); handleScroll();
}); }, lifetime());
_scroll->geometryChanged(
) | rpl::start_with_next(crl::guard(_list, [=] {
_list->onParentGeometryChanged();
}), lifetime());
_historyDown->addClickHandler([=] { historyDownClicked(); }); _historyDown->addClickHandler([=] { historyDownClicked(); });
_unreadMentions->addClickHandler([=] { showNextUnreadMention(); }); _unreadMentions->addClickHandler([=] { showNextUnreadMention(); });
_fieldBarCancel->addClickHandler([=] { cancelFieldAreaState(); }); _fieldBarCancel->addClickHandler([=] { cancelFieldAreaState(); });
@ -2133,8 +2138,6 @@ void HistoryWidget::showHistory(
updateControlsGeometry(); updateControlsGeometry();
connect(_scroll, SIGNAL(geometryChanged()), _list, SLOT(onParentGeometryChanged()));
if (const auto user = _peer->asUser()) { if (const auto user = _peer->asUser()) {
if (const auto &info = user->botInfo) { if (const auto &info = user->botInfo) {
if (startBot) { if (startBot) {

View File

@ -157,7 +157,10 @@ PinnedWidget::PinnedWidget(
static_cast<ListDelegate*>(this))); static_cast<ListDelegate*>(this)));
_scroll->move(0, _topBar->height()); _scroll->move(0, _topBar->height());
_scroll->show(); _scroll->show();
connect(_scroll.get(), &Ui::ScrollArea::scrolled, [=] { onScroll(); }); _scroll->scrolls(
) | rpl::start_with_next([=] {
onScroll();
}, lifetime());
setupClearButton(); setupClearButton();
setupScrollDownButton(); setupScrollDownButton();

View File

@ -224,7 +224,10 @@ RepliesWidget::RepliesWidget(
static_cast<ListDelegate*>(this))); static_cast<ListDelegate*>(this)));
_scroll->move(0, _topBar->height()); _scroll->move(0, _topBar->height());
_scroll->show(); _scroll->show();
connect(_scroll.get(), &Ui::ScrollArea::scrolled, [=] { onScroll(); }); _scroll->scrolls(
) | rpl::start_with_next([=] {
onScroll();
}, lifetime());
_inner->editMessageRequested( _inner->editMessageRequested(
) | rpl::start_with_next([=](auto fullId) { ) | rpl::start_with_next([=](auto fullId) {

View File

@ -155,7 +155,10 @@ ScheduledWidget::ScheduledWidget(
static_cast<ListDelegate*>(this))); static_cast<ListDelegate*>(this)));
_scroll->move(0, _topBar->height()); _scroll->move(0, _topBar->height());
_scroll->show(); _scroll->show();
connect(_scroll, &Ui::ScrollArea::scrolled, [=] { onScroll(); }); _scroll->scrolls(
) | rpl::start_with_next([=] {
onScroll();
}, lifetime());
_inner->editMessageRequested( _inner->editMessageRequested(
) | rpl::start_with_next([=](auto fullId) { ) | rpl::start_with_next([=](auto fullId) {

View File

@ -48,11 +48,10 @@ Widget::Widget(
_inner->moveToLeft(0, 0, _scroll->width()); _inner->moveToLeft(0, 0, _scroll->width());
connect( _scroll->scrolls(
_scroll, ) | rpl::start_with_next([=] {
&Ui::ScrollArea::scrolled, onScroll();
this, }, lifetime());
&InlineBots::Layout::Widget::onScroll);
_inner->inlineRowsCleared( _inner->inlineRowsCleared(
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {

@ -1 +1 @@
Subproject commit a827d9436e9ca258dfdfb9b67ef1ad917c13c5b5 Subproject commit 7182fad08a004b86697af27c971c16bb12c8b421