mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v6.3.10' & extra into dev
This commit is contained in:
@@ -53,7 +53,7 @@ base::flat_map<not_null<Main::Session*>, SessionProcesses> Processes;
|
||||
const auto j = Processes.emplace(session).first;
|
||||
auto &result = j->second;
|
||||
session->account().sessionChanges(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
Processes.erase(session);
|
||||
}, result.lifetime);
|
||||
return result;
|
||||
@@ -325,17 +325,17 @@ CheckoutProcess::CheckoutProcess(
|
||||
, _reactivate(std::move(reactivate))
|
||||
, _nonPanelPaymentFormProcess(std::move(nonPanelPaymentFormProcess)) {
|
||||
_form->updates(
|
||||
) | rpl::start_with_next([=](const FormUpdate &update) {
|
||||
) | rpl::on_next([=](const FormUpdate &update) {
|
||||
handleFormUpdate(update);
|
||||
}, _lifetime);
|
||||
|
||||
_panel->savedMethodChosen(
|
||||
) | rpl::start_with_next([=](QString id) {
|
||||
) | rpl::on_next([=](QString id) {
|
||||
_form->chooseSavedMethod(id);
|
||||
}, _panel->lifetime());
|
||||
|
||||
_panel->backRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
panelCancelEdit();
|
||||
}, _panel->lifetime());
|
||||
if (!_nonPanelPaymentFormProcess) {
|
||||
@@ -345,7 +345,7 @@ CheckoutProcess::CheckoutProcess(
|
||||
|
||||
if (mode == Mode::Payment) {
|
||||
_session->api().cloudPassword().state(
|
||||
) | rpl::start_with_next([=](const Core::CloudPasswordState &state) {
|
||||
) | rpl::on_next([=](const Core::CloudPasswordState &state) {
|
||||
_form->setHasPassword(state.hasPassword);
|
||||
}, _lifetime);
|
||||
}
|
||||
@@ -878,12 +878,12 @@ void CheckoutProcess::panelSetPassword() {
|
||||
rpl::merge(
|
||||
box->newPasswordSet() | rpl::to_empty,
|
||||
box->passwordReloadNeeded()
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_session->api().cloudPassword().reload();
|
||||
}, box->lifetime());
|
||||
|
||||
box->clearUnconfirmedPassword(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_session->api().cloudPassword().clearUnconfirmedPassword();
|
||||
}, box->lifetime());
|
||||
|
||||
@@ -903,7 +903,7 @@ void CheckoutProcess::getPasswordState(
|
||||
return;
|
||||
}
|
||||
_session->api().cloudPassword().state(
|
||||
) | rpl::start_with_next([=](const Core::CloudPasswordState &state) {
|
||||
) | rpl::on_next([=](const Core::CloudPasswordState &state) {
|
||||
_gettingPasswordState.destroy();
|
||||
callback(state);
|
||||
}, _gettingPasswordState);
|
||||
|
||||
@@ -158,11 +158,11 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL(
|
||||
| (giveaway.additionalPrize.isEmpty()
|
||||
? Flag()
|
||||
: Flag::f_prize_description)),
|
||||
giveaway.boostPeer->input,
|
||||
giveaway.boostPeer->input(),
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
giveaway.additionalChannels
|
||||
) | ranges::views::transform([](not_null<ChannelData*> c) {
|
||||
return MTPInputPeer(c->input);
|
||||
return MTPInputPeer(c->input());
|
||||
})),
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
giveaway.countries
|
||||
@@ -200,11 +200,11 @@ MTPinputStorePaymentPurpose InvoiceCreditsGiveawayToTL(
|
||||
? Flag()
|
||||
: Flag::f_prize_description)),
|
||||
MTP_long(*invoice.giveawayCredits),
|
||||
giveaway.boostPeer->input,
|
||||
giveaway.boostPeer->input(),
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
giveaway.additionalChannels
|
||||
) | ranges::views::transform([](not_null<ChannelData*> c) {
|
||||
return MTPInputPeer(c->input);
|
||||
return MTPInputPeer(c->input());
|
||||
})),
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
giveaway.countries
|
||||
@@ -296,7 +296,7 @@ void Form::loadThumbnail(not_null<PhotoData*> photo) {
|
||||
_thumbnailLoadProcess->view = std::move(view);
|
||||
photo->load(Data::PhotoSize::Thumbnail, thumbnailFileOrigin());
|
||||
_session->downloaderTaskFinished(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
const auto &view = _thumbnailLoadProcess->view;
|
||||
if (auto good = prepareGoodThumbnail(view); !good.isNull()) {
|
||||
_invoice.cover.thumbnail = std::move(good);
|
||||
@@ -366,7 +366,7 @@ QImage Form::prepareEmptyThumbnail() const {
|
||||
MTPInputInvoice Form::inputInvoice() const {
|
||||
if (const auto message = std::get_if<InvoiceMessage>(&_id.value)) {
|
||||
return MTP_inputInvoiceMessage(
|
||||
message->peer->input,
|
||||
message->peer->input(),
|
||||
MTP_int(message->itemId.bare));
|
||||
} else if (const auto slug = std::get_if<InvoiceSlug>(&_id.value)) {
|
||||
return MTP_inputInvoiceSlug(MTP_string(slug->slug));
|
||||
@@ -375,7 +375,7 @@ MTPInputInvoice Form::inputInvoice() const {
|
||||
if (const auto user = _session->data().user(userId)) {
|
||||
return MTP_inputInvoiceStars(
|
||||
MTP_inputStorePaymentStarsGift(
|
||||
user->inputUser,
|
||||
user->inputUser(),
|
||||
MTP_long(credits->credits),
|
||||
MTP_string(credits->currency),
|
||||
MTP_long(credits->amount)));
|
||||
@@ -394,7 +394,7 @@ MTPInputInvoice Form::inputInvoice() const {
|
||||
MTP_flags((gift->anonymous ? Flag::f_hide_name : Flag(0))
|
||||
| (gift->message.empty() ? Flag(0) : Flag::f_message)
|
||||
| (gift->upgraded ? Flag::f_include_upgrade : Flag(0))),
|
||||
gift->recipient->input,
|
||||
gift->recipient->input(),
|
||||
MTP_long(gift->giftId),
|
||||
MTP_textWithEntities(
|
||||
MTP_string(gift->message.text),
|
||||
@@ -435,7 +435,7 @@ MTPInputInvoice Form::inputInvoice() const {
|
||||
using Flag = MTPDinputInvoicePremiumGiftStars::Flag;
|
||||
return MTP_inputInvoicePremiumGiftStars(
|
||||
MTP_flags(message ? Flag::f_message : Flag()),
|
||||
users->users.front()->inputUser,
|
||||
users->users.front()->inputUser(),
|
||||
MTP_int(giftCode.months),
|
||||
message.value_or(MTPTextWithEntities()));
|
||||
} else if (users) {
|
||||
@@ -447,9 +447,9 @@ MTPInputInvoice Form::inputInvoice() const {
|
||||
MTP_vector_from_range(ranges::views::all(
|
||||
users->users
|
||||
) | ranges::views::transform([](not_null<UserData*> user) {
|
||||
return MTPInputUser(user->inputUser);
|
||||
return MTPInputUser(user->inputUser());
|
||||
})),
|
||||
users->boostPeer ? users->boostPeer->input : MTPInputPeer(),
|
||||
users->boostPeer ? users->boostPeer->input() : MTPInputPeer(),
|
||||
MTP_string(giftCode.currency),
|
||||
MTP_long(giftCode.amount),
|
||||
message.value_or(MTPTextWithEntities())),
|
||||
@@ -550,7 +550,7 @@ void Form::requestReceipt() {
|
||||
const auto message = v::get<InvoiceMessage>(_id.value);
|
||||
showProgress();
|
||||
_api.request(MTPpayments_GetPaymentReceipt(
|
||||
message.peer->input,
|
||||
message.peer->input(),
|
||||
MTP_int(message.itemId.bare)
|
||||
)).done([=](const MTPpayments_PaymentReceipt &result) {
|
||||
hideProgress();
|
||||
|
||||
@@ -71,7 +71,7 @@ void ProcessCreditsPayment(
|
||||
tr::now,
|
||||
lt_count_decimal,
|
||||
form->starGiftLimitedCount,
|
||||
Ui::Text::RichLangValue),
|
||||
tr::rich),
|
||||
});
|
||||
} else {
|
||||
show->showToast(
|
||||
@@ -83,7 +83,7 @@ void ProcessCreditsPayment(
|
||||
tr::now,
|
||||
lt_count,
|
||||
std::max(form->starGiftPerUserLimit, 1),
|
||||
Ui::Text::RichLangValue),
|
||||
tr::rich),
|
||||
});
|
||||
} else {
|
||||
show->showToast(*error);
|
||||
@@ -111,7 +111,7 @@ void ProcessCreditsPayment(
|
||||
onstack(CheckoutResult::Paid);
|
||||
}
|
||||
}));
|
||||
box->boxClosing() | rpl::start_with_next([=] {
|
||||
box->boxClosing() | rpl::on_next([=] {
|
||||
crl::on_main([=] {
|
||||
if (*unsuccessful) {
|
||||
if (const auto onstack = maybeReturnToBot) {
|
||||
|
||||
@@ -220,7 +220,7 @@ void ShowPaidReactionDetails(
|
||||
return tr::lng_paid_react_send(
|
||||
lt_price,
|
||||
std::move(nice),
|
||||
Ui::Text::RichLangValue);
|
||||
tr::rich);
|
||||
};
|
||||
auto top = std::vector<Ui::PaidReactionTop>();
|
||||
const auto add = [&](const Data::MessageReactionsTopPaid &entry) {
|
||||
@@ -298,7 +298,7 @@ void ShowPaidReactionDetails(
|
||||
|
||||
if (const auto strong = state->selectBox.get()) {
|
||||
session->data().itemRemoved(
|
||||
) | rpl::start_with_next([=](not_null<const HistoryItem*> removed) {
|
||||
) | rpl::on_next([=](not_null<const HistoryItem*> removed) {
|
||||
if (removed == item) {
|
||||
strong->closeBox();
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ not_null<RpWidget*> EditCard::setupContent() {
|
||||
object_ptr<VerticalLayout>(this));
|
||||
|
||||
_scroll->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
) | rpl::on_next([=](int width) {
|
||||
inner->resizeToWidth(width);
|
||||
}, inner->lifetime());
|
||||
|
||||
@@ -317,7 +317,7 @@ not_null<RpWidget*> EditCard::setupContent() {
|
||||
.validator = CvcValidator([=] { return _number->value(); }),
|
||||
});
|
||||
container->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
) | rpl::on_next([=](int width) {
|
||||
const auto left = (width - st::paymentsExpireCvcSkip) / 2;
|
||||
const auto right = width - st::paymentsExpireCvcSkip - left;
|
||||
_expire->widget()->resizeToWidth(left);
|
||||
@@ -359,7 +359,7 @@ not_null<RpWidget*> EditCard::setupContent() {
|
||||
});
|
||||
if (_country) {
|
||||
_country->finished(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_zip->setFocus();
|
||||
}, lifetime());
|
||||
}
|
||||
@@ -374,7 +374,7 @@ not_null<RpWidget*> EditCard::setupContent() {
|
||||
}
|
||||
|
||||
last->submitted(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_delegate->panelValidateCard(collect(), _save && _save->checked());
|
||||
}, lifetime());
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ not_null<RpWidget*> EditInformation::setupContent() {
|
||||
object_ptr<VerticalLayout>(this));
|
||||
|
||||
_scroll->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
) | rpl::on_next([=](int width) {
|
||||
inner->resizeToWidth(width);
|
||||
}, inner->lifetime());
|
||||
|
||||
@@ -209,7 +209,7 @@ not_null<RpWidget*> EditInformation::setupContent() {
|
||||
|
||||
if (last) {
|
||||
last->submitted(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_delegate->panelValidateInformation(collect());
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ struct SimpleFieldState {
|
||||
};
|
||||
std::move(
|
||||
textPossiblyChanged
|
||||
) | rpl::start_with_next(updateRight, result->lifetime());
|
||||
) | rpl::on_next(updateRight, result->lifetime());
|
||||
if (state->left) {
|
||||
state->left->raise();
|
||||
}
|
||||
@@ -478,11 +478,11 @@ void Field::setupMaskedGeometry() {
|
||||
|
||||
_wrap->resize(_masked->size());
|
||||
_wrap->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
) | rpl::on_next([=](int width) {
|
||||
_masked->resize(width, _masked->height());
|
||||
}, _masked->lifetime());
|
||||
_masked->heightValue(
|
||||
) | rpl::start_with_next([=](int height) {
|
||||
) | rpl::on_next([=](int height) {
|
||||
_wrap->resize(_wrap->width(), height);
|
||||
}, _masked->lifetime());
|
||||
}
|
||||
@@ -506,7 +506,7 @@ void Field::setupCountry() {
|
||||
CountrySelectBox::Type::Countries);
|
||||
const auto raw = box.data();
|
||||
raw->countryChosen(
|
||||
) | rpl::start_with_next([=](QString iso2) {
|
||||
) | rpl::on_next([=](QString iso2) {
|
||||
_countryIso2 = iso2;
|
||||
_masked->setText(Countries::Instance().countryNameByISO2(iso2));
|
||||
_masked->hideError();
|
||||
@@ -519,7 +519,7 @@ void Field::setupCountry() {
|
||||
}
|
||||
}
|
||||
}, _masked->lifetime());
|
||||
raw->boxClosing() | rpl::start_with_next([=] {
|
||||
raw->boxClosing() | rpl::on_next([=] {
|
||||
setFocus();
|
||||
}, _masked->lifetime());
|
||||
_config.showBox(std::move(box));
|
||||
@@ -613,7 +613,7 @@ void Field::setupValidator(Fn<ValidateResult(ValidateRequest)> validator) {
|
||||
const auto raw = _input->rawTextEdit();
|
||||
QObject::connect(raw, &QTextEdit::cursorPositionChanged, save);
|
||||
_input->changes(
|
||||
) | rpl::start_with_next(validate, _input->lifetime());
|
||||
) | rpl::on_next(validate, _input->lifetime());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,21 +652,21 @@ void Field::setupSubmit() {
|
||||
QObject::connect(_masked, &MaskedInputField::submitted, submitted);
|
||||
} else {
|
||||
_input->submits(
|
||||
) | rpl::start_with_next(submitted, _input->lifetime());
|
||||
) | rpl::on_next(submitted, _input->lifetime());
|
||||
}
|
||||
}
|
||||
|
||||
void Field::setNextField(not_null<Field*> field) {
|
||||
_nextField = field;
|
||||
|
||||
finished() | rpl::start_with_next([=] {
|
||||
finished() | rpl::on_next([=] {
|
||||
field->setFocus();
|
||||
}, _masked ? _masked->lifetime() : _input->lifetime());
|
||||
}
|
||||
|
||||
void Field::setPreviousField(not_null<Field*> field) {
|
||||
frontBackspace(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
field->setFocus();
|
||||
}, _masked ? _masked->lifetime() : _input->lifetime());
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ void FormSummary::setupControls() {
|
||||
rpl::merge(
|
||||
(_submit ? _submit->widthValue() : rpl::single(0)),
|
||||
_cancel->widthValue()
|
||||
) | rpl::skip(2) | rpl::start_with_next([=] {
|
||||
) | rpl::skip(2) | rpl::on_next([=] {
|
||||
updateControlsGeometry();
|
||||
}, lifetime());
|
||||
}
|
||||
@@ -227,7 +227,7 @@ void FormSummary::setupCover(not_null<VerticalLayout*> layout) {
|
||||
_invoice.cover.seller,
|
||||
st::paymentsSeller);
|
||||
cover->paintRequest(
|
||||
) | rpl::start_with_next([=](QRect clip) {
|
||||
) | rpl::on_next([=](QRect clip) {
|
||||
if (state->thumbnail.isNull()) {
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void FormSummary::setupCover(not_null<VerticalLayout*> layout) {
|
||||
rpl::combine(
|
||||
cover->widthValue(),
|
||||
_thumbnails.events_starting_with_copy(_invoice.cover.thumbnail)
|
||||
) | rpl::start_with_next([=](int width, QImage &&thumbnail) {
|
||||
) | rpl::on_next([=](int width, QImage &&thumbnail) {
|
||||
const auto &padding = st::paymentsCoverPadding;
|
||||
const auto thumbnailSkip = st::paymentsThumbnailSize.width()
|
||||
+ st::paymentsThumbnailSkip;
|
||||
@@ -314,7 +314,7 @@ void FormSummary::setupPrices(not_null<VerticalLayout*> layout) {
|
||||
rpl::combine(
|
||||
left->topValue(),
|
||||
layout->widthValue()
|
||||
) | rpl::start_with_next([=](int top, int width) {
|
||||
) | rpl::on_next([=](int top, int width) {
|
||||
right->moveToRight(st::paymentsPricePadding.right(), top, width);
|
||||
}, right->lifetime());
|
||||
return right;
|
||||
@@ -362,7 +362,7 @@ void FormSummary::setupPrices(not_null<VerticalLayout*> layout) {
|
||||
const auto text = formatAmount(_invoice.tipsSelected);
|
||||
const auto label = addRow(
|
||||
tr::lng_payments_tips_label(tr::now),
|
||||
Ui::Text::Link(text));
|
||||
tr::link(text));
|
||||
label->overrideLinkClickHandler([=] {
|
||||
_delegate->panelChooseTips();
|
||||
});
|
||||
@@ -411,7 +411,7 @@ void FormSummary::setupSuggestedTips(not_null<VerticalLayout*> layout) {
|
||||
outer->widthValue(
|
||||
) | rpl::filter([=](int outerWidth) {
|
||||
return outerWidth >= state->maxWidth;
|
||||
}) | rpl::start_with_next([=](int outerWidth) {
|
||||
}) | rpl::on_next([=](int outerWidth) {
|
||||
const auto skip = st::paymentsTipSkip;
|
||||
const auto &buttons = state->buttons;
|
||||
auto left = outerWidth;
|
||||
@@ -565,7 +565,7 @@ void FormSummary::setupSections(not_null<VerticalLayout*> layout) {
|
||||
|
||||
void FormSummary::setupContent(not_null<VerticalLayout*> layout) {
|
||||
_scroll->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
) | rpl::on_next([=](int width) {
|
||||
layout->resizeToWidth(width);
|
||||
}, layout->lifetime());
|
||||
|
||||
|
||||
@@ -75,19 +75,19 @@ Panel::Panel(not_null<PanelDelegate*> delegate)
|
||||
_widget->setInnerSize(st::paymentsPanelSize);
|
||||
|
||||
_widget->closeRequests(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_delegate->panelRequestClose();
|
||||
}, _widget->lifetime());
|
||||
|
||||
_widget->closeEvents(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_delegate->panelCloseSure();
|
||||
}, _widget->lifetime());
|
||||
|
||||
style::PaletteChanged(
|
||||
) | rpl::filter([=] {
|
||||
return !_themeUpdateScheduled;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
_themeUpdateScheduled = true;
|
||||
crl::on_main(_widget.get(), [=] {
|
||||
_themeUpdateScheduled = false;
|
||||
@@ -115,7 +115,7 @@ void Panel::toggleProgress(bool shown) {
|
||||
_widget.get(),
|
||||
[=] { return progressRect(); });
|
||||
_progress->widget.paintRequest(
|
||||
) | rpl::start_with_next([=](QRect clip) {
|
||||
) | rpl::on_next([=](QRect clip) {
|
||||
auto p = QPainter(&_progress->widget);
|
||||
p.setOpacity(
|
||||
_progress->shownAnimation.value(_progress->shown ? 1. : 0.));
|
||||
@@ -183,7 +183,7 @@ void Panel::setupProgressGeometry() {
|
||||
_progress->geometryLifetime.destroy();
|
||||
if (_webviewBottom) {
|
||||
_webviewBottom->geometryValue(
|
||||
) | rpl::start_with_next([=](QRect bottom) {
|
||||
) | rpl::on_next([=](QRect bottom) {
|
||||
const auto height = bottom.height();
|
||||
const auto size = st::paymentsLoading.size;
|
||||
const auto skip = (height - size.height()) / 2;
|
||||
@@ -201,7 +201,7 @@ void Panel::setupProgressGeometry() {
|
||||
}, _progress->geometryLifetime);
|
||||
} else if (_weakFormSummary) {
|
||||
_weakFormSummary->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize form) {
|
||||
) | rpl::on_next([=](QSize form) {
|
||||
const auto full = _widget->innerGeometry();
|
||||
const auto size = st::defaultBoxButton.height;
|
||||
const auto inner = _weakFormSummary->contentHeight();
|
||||
@@ -218,12 +218,12 @@ void Panel::setupProgressGeometry() {
|
||||
}, _progress->geometryLifetime);
|
||||
} else if (_weakEditInformation) {
|
||||
_weakEditInformation->geometryValue(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_progress->widget.setGeometry(_widget->innerGeometry());
|
||||
}, _progress->geometryLifetime);
|
||||
} else if (_weakEditCard) {
|
||||
_weakEditCard->geometryValue(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_progress->widget.setGeometry(_widget->innerGeometry());
|
||||
}, _progress->geometryLifetime);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ void Panel::chooseShippingOption(const ShippingOptions &options) {
|
||||
const auto area = CreateChild<AbstractButton>(layout.get());
|
||||
area->setClickedCallback([=] { group->setValue(index); });
|
||||
button->geometryValue(
|
||||
) | rpl::start_with_next([=](QRect geometry) {
|
||||
) | rpl::on_next([=](QRect geometry) {
|
||||
label->move(
|
||||
geometry.topLeft() + st::paymentsShippingLabelPosition);
|
||||
price->move(
|
||||
@@ -417,7 +417,7 @@ void Panel::chooseTips(const Invoice &invoice) {
|
||||
}
|
||||
};
|
||||
row->submitted(
|
||||
) | rpl::start_with_next(submit, box->lifetime());
|
||||
) | rpl::on_next(submit, box->lifetime());
|
||||
box->addButton(tr::lng_settings_save(), submit);
|
||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||
}));
|
||||
@@ -516,7 +516,7 @@ bool Panel::showWebview(
|
||||
rpl::combine(
|
||||
_webviewBottom->widthValue(),
|
||||
label->widthValue()
|
||||
) | rpl::start_with_next([=](int outerWidth, int width) {
|
||||
) | rpl::on_next([=](int outerWidth, int width) {
|
||||
label->move((outerWidth - width) / 2, padding.top());
|
||||
}, label->lifetime());
|
||||
label->show();
|
||||
@@ -540,7 +540,7 @@ bool Panel::createWebview(const Webview::ThemeParams ¶ms) {
|
||||
return _widget->innerGeometry();
|
||||
}),
|
||||
bottom->heightValue()
|
||||
) | rpl::start_with_next([=](QRect inner, int height) {
|
||||
) | rpl::on_next([=](QRect inner, int height) {
|
||||
bottom->move(inner.x(), inner.y() + inner.height() - height);
|
||||
bottom->resizeToWidth(inner.width());
|
||||
_footerHeight = bottom->height();
|
||||
@@ -591,7 +591,7 @@ bool Panel::createWebview(const Webview::ThemeParams ¶ms) {
|
||||
rpl::combine(
|
||||
container->geometryValue(),
|
||||
_footerHeight.value()
|
||||
) | rpl::start_with_next([=](QRect geometry, int footer) {
|
||||
) | rpl::on_next([=](QRect geometry, int footer) {
|
||||
if (const auto view = raw->widget()) {
|
||||
view->setGeometry(geometry.marginsRemoved({ 0, 0, 0, footer }));
|
||||
}
|
||||
@@ -742,8 +742,8 @@ void Panel::requestTermsAcceptance(
|
||||
? tr::lng_payments_terms_text
|
||||
: tr::lng_payments_terms_text_once)(
|
||||
lt_bot,
|
||||
rpl::single(Ui::Text::Bold('@' + username)),
|
||||
Ui::Text::WithEntities),
|
||||
rpl::single(tr::bold('@' + username)),
|
||||
tr::marked),
|
||||
st::boxLabel));
|
||||
const auto update = std::make_shared<Fn<void()>>();
|
||||
auto checkView = std::make_unique<Ui::CheckView>(
|
||||
@@ -756,10 +756,10 @@ void Panel::requestTermsAcceptance(
|
||||
box.get(),
|
||||
tr::lng_payments_terms_agree(
|
||||
lt_link,
|
||||
rpl::single(Ui::Text::Link(
|
||||
rpl::single(tr::link(
|
||||
tr::lng_payments_terms_link(tr::now),
|
||||
url)),
|
||||
Ui::Text::WithEntities),
|
||||
tr::marked),
|
||||
st::defaultBoxCheckbox,
|
||||
std::move(checkView)),
|
||||
{
|
||||
@@ -852,7 +852,7 @@ void Panel::showBox(object_ptr<BoxContent> box) {
|
||||
if (hideNow || _webview->lastHidingBox) {
|
||||
const auto raw = _webview->lastHidingBox = box.data();
|
||||
box->boxClosing(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
const auto widget = _webview
|
||||
? _webview->window.widget()
|
||||
: nullptr;
|
||||
@@ -902,7 +902,7 @@ void Panel::showCriticalError(const TextWithEntities &text) {
|
||||
return false;
|
||||
});
|
||||
|
||||
raw->widthValue() | rpl::start_with_next([=](int width) {
|
||||
raw->widthValue() | rpl::on_next([=](int width) {
|
||||
error->resizeToWidth(width);
|
||||
raw->resize(width, error->height());
|
||||
}, raw->lifetime());
|
||||
|
||||
@@ -89,11 +89,11 @@ void AddArrowDown(not_null<RpWidget*> widget) {
|
||||
const auto skip = st::lineWidth * 4;
|
||||
const auto size = icon->width() + skip * 2;
|
||||
arrow->resize(size, size);
|
||||
widget->widthValue() | rpl::start_with_next([=](int width) {
|
||||
widget->widthValue() | rpl::on_next([=](int width) {
|
||||
const auto left = (width - st::paidReactTopUserpic) / 2;
|
||||
arrow->moveToRight(left - skip, -st::lineWidth, width);
|
||||
}, widget->lifetime());
|
||||
arrow->paintRequest() | rpl::start_with_next([=] {
|
||||
arrow->paintRequest() | rpl::on_next([=] {
|
||||
Painter p(arrow);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setBrush(st::activeButtonBg);
|
||||
@@ -146,10 +146,10 @@ void AddArrowDown(not_null<RpWidget*> widget) {
|
||||
result->update();
|
||||
});
|
||||
style::PaletteChanged(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
state->badge = QImage();
|
||||
}, result->lifetime());
|
||||
result->paintRequest() | rpl::start_with_next([=] {
|
||||
result->paintRequest() | rpl::on_next([=] {
|
||||
auto p = Painter(result);
|
||||
const auto left = (result->width() - st::paidReactTopUserpic) / 2;
|
||||
p.drawImage(left, top, photo->image(st::paidReactTopUserpic));
|
||||
@@ -285,7 +285,7 @@ void FillTopReactors(
|
||||
rpl::combine(
|
||||
std::move(chosen),
|
||||
std::move(shownPeer)
|
||||
) | rpl::start_with_next([=](int chosen, uint64 barePeerId) {
|
||||
) | rpl::on_next([=](int chosen, uint64 barePeerId) {
|
||||
if (!state->initialChosen) {
|
||||
state->initialChosen = chosen;
|
||||
} else if (*state->initialChosen != chosen) {
|
||||
@@ -375,7 +375,7 @@ void FillTopReactors(
|
||||
rpl::combine(
|
||||
state->updated.events_starting_with({}),
|
||||
wrap->widthValue()
|
||||
) | rpl::start_with_next([=](auto, int width) {
|
||||
) | rpl::on_next([=](auto, int width) {
|
||||
if (!state->widgets.empty()) {
|
||||
parent->resize(parent->width(), state->widgets.back()->height());
|
||||
}
|
||||
@@ -405,7 +405,7 @@ void FillTopReactors(
|
||||
const auto subtextHeight = st::starSelectInfoSubtext.style.font->height;
|
||||
const auto height = titleHeight + subtextHeight;
|
||||
|
||||
result->paintRequest() | rpl::start_with_next([=] {
|
||||
result->paintRequest() | rpl::on_next([=] {
|
||||
auto p = QPainter(result);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.setPen(Qt::NoPen);
|
||||
@@ -441,7 +441,7 @@ void FillTopReactors(
|
||||
result->widthValue(),
|
||||
titleLabel->widthValue(),
|
||||
subtextLabel->widthValue()
|
||||
) | rpl::start_with_next([=](int width, int titlew, int subtextw) {
|
||||
) | rpl::on_next([=](int width, int titlew, int subtextw) {
|
||||
const auto padding = st::starSelectInfoPadding;
|
||||
titleLabel->moveToLeft((width - titlew) / 2, padding.top(), width);
|
||||
subtextLabel->moveToLeft(
|
||||
@@ -547,10 +547,10 @@ void PaidReactionsBox(
|
||||
colorings,
|
||||
(videoStreamAdmin
|
||||
? rpl::single(state->chosen.current())
|
||||
: state->chosen.value() | rpl::type_erased()),
|
||||
: state->chosen.value() | rpl::type_erased),
|
||||
(videoStreamAdmin
|
||||
? rpl::single(state->shownPeer.current())
|
||||
: state->shownPeer.value() | rpl::type_erased()),
|
||||
: state->shownPeer.value() | rpl::type_erased),
|
||||
[=](uint64 barePeerId) {
|
||||
state->shownPeer = state->savedShownPeer = barePeerId;
|
||||
},
|
||||
@@ -606,10 +606,10 @@ void PaidReactionsBox(
|
||||
tr::rich)),
|
||||
dark ? st::darkEditStarsText : st::boostText);
|
||||
label->setTryMakeSimilarLines(true);
|
||||
labelWrap->widthValue() | rpl::start_with_next([=](int width) {
|
||||
labelWrap->widthValue() | rpl::on_next([=](int width) {
|
||||
label->resizeToWidth(width);
|
||||
}, label->lifetime());
|
||||
label->heightValue() | rpl::start_with_next([=](int height) {
|
||||
label->heightValue() | rpl::on_next([=](int height) {
|
||||
const auto min = 2 * st::normalFont->height;
|
||||
const auto skip = std::max((min - height) / 2, 0);
|
||||
labelWrap->resize(labelWrap->width(), 2 * skip + height);
|
||||
@@ -629,7 +629,7 @@ void PaidReactionsBox(
|
||||
st::boxRowPadding + QMargins(0, 0, 0, skip),
|
||||
style::al_top);
|
||||
named->checkedValue(
|
||||
) | rpl::start_with_next([=](bool show) {
|
||||
) | rpl::on_next([=](bool show) {
|
||||
state->shownPeer = show ? state->savedShownPeer : 0;
|
||||
}, named->lifetime());
|
||||
}
|
||||
@@ -659,7 +659,7 @@ void PaidReactionsBox(
|
||||
|
||||
box->boxClosing() | rpl::filter([=] {
|
||||
return state->shownPeer.current() != initialShownPeer;
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
args.send(0, state->shownPeer.current());
|
||||
}, box->lifetime());
|
||||
|
||||
@@ -846,7 +846,7 @@ void PaidReactionSlider(
|
||||
: std::max(value, min);
|
||||
};
|
||||
|
||||
std::move(current) | rpl::start_with_next([=](int value) {
|
||||
std::move(current) | rpl::on_next([=](int value) {
|
||||
value = std::clamp(value, 1, max);
|
||||
if (discreter.ratioToValue(slider->value()) != value) {
|
||||
slider->setValue(discreter.valueToRatio(value));
|
||||
@@ -879,7 +879,7 @@ void PaidReactionSlider(
|
||||
const auto stars = Ui::CreateChild<Ui::RpWidget>(slider->parentWidget());
|
||||
stars->show();
|
||||
stars->raise();
|
||||
slider->geometryValue() | rpl::start_with_next([=](QRect rect) {
|
||||
slider->geometryValue() | rpl::on_next([=](QRect rect) {
|
||||
stars->setGeometry(rect);
|
||||
}, stars->lifetime());
|
||||
|
||||
@@ -888,7 +888,7 @@ void PaidReactionSlider(
|
||||
|
||||
const auto seekSize = st::paidReactSlider.seekSize.width();
|
||||
const auto seekRadius = seekSize / 2.;
|
||||
stars->paintRequest() | rpl::start_with_next([=] {
|
||||
stars->paintRequest() | rpl::on_next([=] {
|
||||
if (!state->animation.animating()) {
|
||||
state->animation.start();
|
||||
}
|
||||
@@ -941,7 +941,7 @@ void AddStarSelectBalance(
|
||||
rpl::combine(
|
||||
balance->sizeValue(),
|
||||
box->widthValue()
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
balance->moveToLeft(
|
||||
st::creditsHistoryRightSkip * 2,
|
||||
st::creditsHistoryRightSkip);
|
||||
@@ -981,7 +981,7 @@ not_null<Premium::BubbleWidget*> AddStarSelectBubble(
|
||||
st::boxRowPadding);
|
||||
bubble->show();
|
||||
if (activeFgOverride) {
|
||||
std::move(value) | rpl::start_with_next([=](int count) {
|
||||
std::move(value) | rpl::on_next([=](int count) {
|
||||
bubble->setBrushOverride(activeFgOverride(count));
|
||||
}, bubble->lifetime());
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ object_ptr<RpWidget> MakeStarSelectInfoBlocks(
|
||||
dark));
|
||||
}
|
||||
raw->resize(raw->width(), state->blocks.front()->height());
|
||||
raw->widthValue() | rpl::start_with_next([=](int width) {
|
||||
raw->widthValue() | rpl::on_next([=](int width) {
|
||||
const auto count = int(state->blocks.size());
|
||||
const auto skip = (st::boxRowPadding.left() / 2);
|
||||
const auto single = (width - skip * (count - 1)) / float64(count);
|
||||
|
||||
Reference in New Issue
Block a user