Renamed rpl::start_with_ with rpl::on_.

This commit is contained in:
23rd
2025-12-10 20:51:57 +03:00
parent 29b714dd5f
commit eca8dfb0ec
623 changed files with 4524 additions and 4524 deletions
@@ -396,12 +396,12 @@ base::options::toggle ShowChannelJoinedBelowAbout({
st::infoProfileLabeledPadding - st::infoHoursOuterMargin);
const auto button = result->entity();
const auto inner = Ui::CreateChild<Ui::VerticalLayout>(button);
button->widthValue() | rpl::start_with_next([=](int width) {
button->widthValue() | rpl::on_next([=](int width) {
const auto margin = st::infoHoursOuterMargin;
inner->resizeToWidth(width - margin.left() - margin.right());
inner->move(margin.left(), margin.top());
}, inner->lifetime());
inner->heightValue() | rpl::start_with_next([=](int height) {
inner->heightValue() | rpl::on_next([=](int height) {
const auto margin = st::infoHoursOuterMargin;
height += margin.top() + margin.bottom();
button->resize(button->width(), height);
@@ -558,7 +558,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
const auto timingArrow = Ui::CreateChild<Ui::RpWidget>(openedWrap);
timingArrow->resize(Size(timing->st().style.font->height));
timing->setAttribute(Qt::WA_TransparentForMouseEvents);
state->opened.value() | rpl::start_with_next([=](bool value) {
state->opened.value() | rpl::on_next([=](bool value) {
opened->setTextColorOverride(value
? st::boxTextFgGood->c
: st::boxTextFgError->c);
@@ -568,7 +568,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
openedWrap->widthValue(),
opened->heightValue(),
timing->sizeValue()
) | rpl::start_with_next([=](int width, int h1, QSize size) {
) | rpl::on_next([=](int width, int h1, QSize size) {
opened->moveToLeft(0, 0, width);
timingArrow->moveToRight(0, 0, width);
timing->moveToRight(timingArrow->width(), 0, width);
@@ -614,7 +614,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
labelWrap->widthValue(),
label->heightValue(),
link->sizeValue()
) | rpl::start_with_next([=](int width, int h1, QSize size) {
) | rpl::on_next([=](int width, int h1, QSize size) {
label->moveToLeft(0, 0, width);
link->moveToRight(0, 0, width);
@@ -639,7 +639,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
arrowAnimation->stop();
}
});
timingArrow->paintRequest() | rpl::start_with_next([=] {
timingArrow->paintRequest() | rpl::on_next([=] {
auto p = QPainter(timingArrow);
const auto progress = other->animating()
? (crl::now() - arrowAnimation->started()) / kSlideDuration
@@ -655,7 +655,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
auto hq = PainterHighQualityEnabler(p);
p.fillPath(path, timing->st().textFg);
}, timingArrow->lifetime());
state->expanded.value() | rpl::start_with_next([=] {
state->expanded.value() | rpl::on_next([=] {
arrowAnimation->start();
}, other->lifetime());
}
@@ -694,7 +694,7 @@ base::options::toggle ShowChannelJoinedBelowAbout({
dayWrap->widthValue(),
dayLabel->heightValue(),
dayHours->sizeValue()
) | rpl::start_with_next([=](int width, int h1, QSize size) {
) | rpl::on_next([=](int width, int h1, QSize size) {
dayLabel->moveToLeft(0, 0, width);
dayHours->moveToRight(0, 0, width);
@@ -775,7 +775,7 @@ void DeleteContactNote(
std::move(
notesText
) | rpl::start_with_next([=, raw = notesLine.text](
) | rpl::on_next([=, raw = notesLine.text](
TextWithEntities note) {
TextUtilities::ParseEntities(note, TextParseLinks);
raw->setMarkedText(note, context);
@@ -807,7 +807,7 @@ void DeleteContactNote(
rpl::merge(
notesLine.wrap->events(),
notesLine.subtext->events()
) | rpl::start_with_next([=, raw = notesLine.text](not_null<QEvent*> e) {
) | rpl::on_next([=, raw = notesLine.text](not_null<QEvent*> e) {
if (e->type() == QEvent::ContextMenu) {
const auto ce = static_cast<QContextMenuEvent*>(e.get());
QCoreApplication::postEvent(
@@ -828,7 +828,7 @@ void DeleteContactNote(
rpl::combine(
notesLine.wrap->entity()->widthValue(),
notesLine.subtext->geometryValue()
) | rpl::start_with_next([=, skip = st::lineWidth * 5](
) | rpl::on_next([=, skip = st::lineWidth * 5](
int width,
const QRect &subtextGeometry) {
subtextLabel->moveToRight(
@@ -876,13 +876,13 @@ void DeleteContactNote(
const auto giftIcon = Ui::CreateChild<Ui::RpWidget>(layout);
giftIcon->resize(st::birthdayTodayIcon.size());
layout->sizeValue() | rpl::start_with_next([=](QSize size) {
layout->sizeValue() | rpl::on_next([=](QSize size) {
giftIcon->moveToRight(
0,
(size.height() - giftIcon->height()) / 2,
size.width());
}, giftIcon->lifetime());
giftIcon->paintRequest() | rpl::start_with_next([=] {
giftIcon->paintRequest() | rpl::on_next([=] {
auto p = QPainter(giftIcon);
st::birthdayTodayIcon.paint(p, 0, 0, giftIcon->width());
}, giftIcon->lifetime());
@@ -893,7 +893,7 @@ void DeleteContactNote(
return Data::IsBirthdayTodayValue(value);
}) | rpl::flatten_latest(
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool today) {
) | rpl::on_next([=](bool today) {
const auto disable = !today && user->session().premiumCanBuy();
button->setDisabled(disable);
button->setAttribute(Qt::WA_TransparentForMouseEvents, disable);
@@ -1014,13 +1014,13 @@ rpl::producer<CreditsAmount> AddCurrencyAction(
const auto icon = Ui::CreateChild<Ui::RpWidget>(button);
icon->resize(st::infoIconReport.size());
const auto image = Ui::Earn::MenuIconCurrency(icon->size());
icon->paintRequest() | rpl::start_with_next([=] {
icon->paintRequest() | rpl::on_next([=] {
auto p = QPainter(icon);
p.drawImage(0, 0, image);
}, icon->lifetime());
button->sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
icon->move(st::infoEarnCurrencyIconPosition);
}, icon->lifetime());
}
@@ -1040,7 +1040,7 @@ rpl::producer<CreditsAmount> AddCurrencyAction(
currencyLoadLifetime->destroy();
}
};
currencyLoad->request() | rpl::start_with_error_done(
currencyLoad->request() | rpl::on_error_done(
[=](const QString &error) {
done(CreditsAmount(0, CreditsType::Ton));
},
@@ -1060,7 +1060,7 @@ rpl::producer<CreditsAmount> AddCurrencyAction(
button->widthValue(),
tr::lng_manage_peer_bot_balance_currency(),
state->balance.value()
) | rpl::start_with_next([=, &st](
) | rpl::on_next([=, &st](
int width,
const QString &button,
CreditsAmount balance) {
@@ -1103,13 +1103,13 @@ rpl::producer<CreditsAmount> AddCreditsAction(
const auto icon = Ui::CreateChild<Ui::RpWidget>(button);
const auto image = Ui::Earn::MenuIconCredits();
icon->resize(image.size() / style::DevicePixelRatio());
icon->paintRequest() | rpl::start_with_next([=] {
icon->paintRequest() | rpl::on_next([=] {
auto p = QPainter(icon);
p.drawImage(0, 0, image);
}, icon->lifetime());
button->sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
icon->move(st::infoEarnCreditsIconPosition);
}, icon->lifetime());
}
@@ -1135,7 +1135,7 @@ rpl::producer<CreditsAmount> AddCreditsAction(
button->widthValue(),
tr::lng_manage_peer_bot_balance_credits(),
state->balance.value()
) | rpl::start_with_next([=, &st](
) | rpl::on_next([=, &st](
int width,
const QString &button,
CreditsAmount balance) {
@@ -1518,7 +1518,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
label->geometryValue(),
button->sizeValue(),
button->shownValue()
) | rpl::start_with_next([=](
) | rpl::on_next([=](
int width,
QRect,
QSize buttonSize,
@@ -1649,7 +1649,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
const auto qrButton = Ui::CreateChild<Ui::IconButton>(
usernameLine.text->parentWidget(),
st::infoProfileLabeledButtonQr);
UsernamesValue(_peer) | rpl::start_with_next([=](const auto &u) {
UsernamesValue(_peer) | rpl::on_next([=](const auto &u) {
qrButton->setVisible(!u.empty());
}, qrButton->lifetime());
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
@@ -1729,7 +1729,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
const auto qr = Ui::CreateChild<Ui::IconButton>(
linkLine.text->parentWidget(),
st::infoProfileLabeledButtonQr);
UsernamesValue(_peer) | rpl::start_with_next([=](const auto &u) {
UsernamesValue(_peer) | rpl::on_next([=](const auto &u) {
qr->setVisible(!u.empty());
}, qr->lifetime());
const auto rightSkip = st::infoProfileLabeledButtonQrRightSkip;
@@ -1864,7 +1864,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
}));
messageChannelWrap->finishAnimating();
messageChannelWrap->toggledValue(
) | rpl::filter(rpl::mappers::_1) | rpl::start_with_next([=] {
) | rpl::filter(rpl::mappers::_1) | rpl::on_next([=] {
messageChannelWrap->resizeToWidth(messageChannelWrap->width());
}, messageChannelWrap->lifetime());
@@ -1925,7 +1925,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
state->item = item;
item->history()->session().changes().realtimeMessageUpdates(
Data::MessageUpdate::Flag::Destroyed
) | rpl::start_with_next([=](const Data::MessageUpdate &update) {
) | rpl::on_next([=](const Data::MessageUpdate &update) {
if (update.item == state->item) {
state->lifetime.destroy();
state->item = nullptr;
@@ -1935,7 +1935,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
preview->resize(0, st::infoLabeled.style.font->height);
preview->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = Painter(preview);
const auto item = state->item;
if (!item) {
@@ -1964,7 +1964,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
}, preview->lifetime());
line->sizeValue() | rpl::filter_size(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
const auto left = stLabeled.left();
const auto right = st::infoPersonalChannelDateSkip;
const auto top = stLabeled.top();
@@ -2003,7 +2003,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
messageChannelWrap->entity(),
st::defaultRippleAnimation);
inner->geometryValue(
) | rpl::start_with_next([=](const QRect &rect) {
) | rpl::on_next([=](const QRect &rect) {
button->setGeometry(rect);
}, button->lifetime());
button->setClickedCallback([=, msg = item->fullId().msg] {
@@ -2027,7 +2027,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
rpl::duplicate(
channel
) | rpl::start_with_next([=](ChannelData *channel) {
) | rpl::on_next([=](ChannelData *channel) {
clear();
if (!channel) {
return;
@@ -2116,7 +2116,7 @@ void DetailsFiller::setupBotPermissions() {
rpl::single(bool(user->botInfo->canManageEmojiStatus))
)->toggledValue() | rpl::filter([=](bool allowed) {
return allowed != user->botInfo->canManageEmojiStatus;
}) | rpl::start_with_next([=](bool allowed) {
}) | rpl::on_next([=](bool allowed) {
user->botInfo->canManageEmojiStatus = allowed;
const auto session = &user->session();
session->api().request(MTPbots_ToggleUserEmojiStatusPermission(
@@ -2180,7 +2180,7 @@ void DetailsFiller::addReportReaction(
*forceHidden = true;
};
wrap->toggleOn(rpl::duplicate(shown));
rpl::duplicate(shown) | rpl::start_with_next([=](bool shown) {
rpl::duplicate(shown) | rpl::on_next([=](bool shown) {
if (shown) {
_dividerOverridden.force_assign(false);
}
@@ -2472,7 +2472,7 @@ void ActionsFiller::addFastButtonsMode(not_null<UserData*> user) {
button->toggledValue(
) | rpl::filter([=](bool value) {
return value != bots->enabled(user);
}) | rpl::start_with_next([=](bool value) {
}) | rpl::on_next([=](bool value) {
bots->setEnabled(user, value);
}, button->lifetime());
}
@@ -2800,7 +2800,7 @@ void SetupAddChannelMember(
Window::PeerMenuAddChannelMembers(navigation, channel);
});
parent->widthValue(
) | rpl::start_with_next([add](int newWidth) {
) | rpl::on_next([add](int newWidth) {
auto availableWidth = newWidth
- st::infoMembersButtonPosition.x();
add->moveToLeft(
@@ -3026,7 +3026,7 @@ Cover *AddCover(
shown,
[=] { return controller->wrapWidget(); }));
result->showSection(
) | rpl::start_with_next([=](Section section) {
) | rpl::on_next([=](Section section) {
controller->showSection(topic
? std::make_shared<Info::Memento>(topic, section)
: std::make_shared<Info::Memento>(shown, section));