mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Renamed rpl::start_with_ with rpl::on_.
This commit is contained in:
@@ -407,14 +407,14 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
{
|
||||
const auto separator = Ui::CreateChild<Ui::RpWidget>(container.get());
|
||||
separator->paintRequest(
|
||||
) | rpl::start_with_next([=, bg = st.textBgOver] {
|
||||
) | rpl::on_next([=, bg = st.textBgOver] {
|
||||
auto p = QPainter(separator);
|
||||
p.fillRect(separator->rect(), bg);
|
||||
}, separator->lifetime());
|
||||
const auto separatorHeight = 2 * st.toggle.border
|
||||
+ st.toggle.diameter;
|
||||
button->geometryValue(
|
||||
) | rpl::start_with_next([=](const QRect &r) {
|
||||
) | rpl::on_next([=](const QRect &r) {
|
||||
const auto w = st::rightsButtonToggleWidth;
|
||||
toggleButton->setGeometry(
|
||||
r.x() + r.width() - w,
|
||||
@@ -431,12 +431,12 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
const auto checkWidget = Ui::CreateChild<Ui::RpWidget>(toggleButton);
|
||||
checkWidget->resize(checkView->getSize());
|
||||
checkWidget->paintRequest(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
auto p = QPainter(checkWidget);
|
||||
checkView->paint(p, 0, 0, checkWidget->width());
|
||||
}, checkWidget->lifetime());
|
||||
toggleButton->sizeValue(
|
||||
) | rpl::start_with_next([=](const QSize &s) {
|
||||
) | rpl::on_next([=](const QSize &s) {
|
||||
checkWidget->moveToRight(
|
||||
st.toggleSkip,
|
||||
(s.height() - checkWidget->height()) / 2);
|
||||
@@ -444,7 +444,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
}
|
||||
state->anyChanges.events_starting_with(
|
||||
rpl::empty_value()
|
||||
) | rpl::map(countChecked) | rpl::start_with_next([=](int count) {
|
||||
) | rpl::map(countChecked) | rpl::on_next([=](int count) {
|
||||
checkView->setChecked(count > 0, anim::type::normal);
|
||||
}, toggleButton->lifetime());
|
||||
checkView->setLocked(locked.has_value());
|
||||
@@ -471,7 +471,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
const auto &icon = st::permissionsExpandIcon;
|
||||
arrow->resize(icon.size());
|
||||
arrow->paintRequest(
|
||||
) | rpl::start_with_next([=, &icon] {
|
||||
) | rpl::on_next([=, &icon] {
|
||||
auto p = QPainter(arrow);
|
||||
const auto center = QPointF(
|
||||
icon.width() / 2.,
|
||||
@@ -489,7 +489,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
}, arrow->lifetime());
|
||||
}
|
||||
button->sizeValue(
|
||||
) | rpl::start_with_next([=, &st](const QSize &s) {
|
||||
) | rpl::on_next([=, &st](const QSize &s) {
|
||||
const auto labelLeft = st.padding.left();
|
||||
const auto labelRight = s.width() - toggleButton->width();
|
||||
|
||||
@@ -504,7 +504,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
(s.height() - arrow->height()) / 2);
|
||||
}, button->lifetime());
|
||||
wrap->toggledValue(
|
||||
) | rpl::skip(1) | rpl::start_with_next([=](bool toggled) {
|
||||
) | rpl::skip(1) | rpl::on_next([=](bool toggled) {
|
||||
state->animation.start(
|
||||
[=] { arrow->update(); },
|
||||
toggled ? 0. : 1.,
|
||||
@@ -521,14 +521,14 @@ not_null<Ui::RpWidget*> AddInnerToggle(
|
||||
};
|
||||
|
||||
button->clicks(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
if (!handleLocked()) {
|
||||
wrap->toggle(!wrap->toggled(), anim::type::normal);
|
||||
}
|
||||
}, button->lifetime());
|
||||
|
||||
toggleButton->clicks(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
if (!handleLocked()) {
|
||||
const auto checked = !checkView->checked();
|
||||
for (const auto &innerCheck : state->innerChecks) {
|
||||
@@ -563,7 +563,7 @@ template <typename Flags>
|
||||
});
|
||||
|
||||
state->forceDisabled.value(
|
||||
) | rpl::start_with_next([=](bool disabled) {
|
||||
) | rpl::on_next([=](bool disabled) {
|
||||
if (disabled) {
|
||||
for (const auto &[flags, checkView] : state->checkViews) {
|
||||
checkView->setChecked(false, anim::type::normal);
|
||||
@@ -629,7 +629,7 @@ template <typename Flags>
|
||||
rpl::combine(
|
||||
verticalLayout->widthValue(),
|
||||
checkbox->geometryValue()
|
||||
) | rpl::start_with_next([=](int w, const QRect &r) {
|
||||
) | rpl::on_next([=](int w, const QRect &r) {
|
||||
button->setGeometry(0, r.y(), w, r.height());
|
||||
}, button->lifetime());
|
||||
checkbox->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
@@ -659,12 +659,12 @@ template <typename Flags>
|
||||
[=] { toggle->update(); });
|
||||
toggle->resize(checkView->getSize());
|
||||
toggle->paintRequest(
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
auto p = QPainter(toggle);
|
||||
checkView->paint(p, 0, 0, toggle->width());
|
||||
}, toggle->lifetime());
|
||||
button->sizeValue(
|
||||
) | rpl::start_with_next([=](const QSize &s) {
|
||||
) | rpl::on_next([=](const QSize &s) {
|
||||
toggle->moveToRight(
|
||||
st.toggleSkip,
|
||||
(s.height() - toggle->height()) / 2);
|
||||
@@ -680,7 +680,7 @@ template <typename Flags>
|
||||
}();
|
||||
state->checkViews.emplace(flags, checkView);
|
||||
checkView->checkedChanges(
|
||||
) | rpl::start_with_next([=](bool checked) {
|
||||
) | rpl::on_next([=](bool checked) {
|
||||
if (checked && state->forceDisabled.current()) {
|
||||
if (!state->toast) {
|
||||
state->toast = Ui::Toast::Show(container, {
|
||||
@@ -742,7 +742,7 @@ template <typename Flags>
|
||||
{ nestedWithLabel.nested.front().icon });
|
||||
container->add(std::move(wrap));
|
||||
container->widthValue(
|
||||
) | rpl::start_with_next([=](int w) {
|
||||
) | rpl::on_next([=](int w) {
|
||||
raw->resizeToWidth(w);
|
||||
}, raw->lifetime());
|
||||
}
|
||||
@@ -780,7 +780,7 @@ void AddSlowmodeLabels(
|
||||
rpl::combine(
|
||||
labels->widthValue(),
|
||||
label->widthValue()
|
||||
) | rpl::start_with_next([=](int outer, int inner) {
|
||||
) | rpl::on_next([=](int outer, int inner) {
|
||||
const auto skip = st::localStorageLimitMargin;
|
||||
const auto size = st::localStorageLimitSlider.seekSize;
|
||||
const auto available = outer
|
||||
@@ -903,7 +903,7 @@ void AddBoostsUnrestrictLabels(not_null<Ui::VerticalLayout*> container) {
|
||||
rpl::combine(
|
||||
labels->widthValue(),
|
||||
label->widthValue()
|
||||
) | rpl::start_with_next([=](int outer, int inner) {
|
||||
) | rpl::on_next([=](int outer, int inner) {
|
||||
const auto skip = st::localStorageLimitMargin;
|
||||
const auto size = st::localStorageLimitSlider.seekSize;
|
||||
const auto available = outer
|
||||
@@ -948,7 +948,7 @@ rpl::producer<int> AddBoostsUnrestrictSlider(
|
||||
tr::lng_rights_boosts_no_restrict(),
|
||||
st::defaultSettingsButton
|
||||
))->toggleOn(rpl::duplicate(enabled))->toggledValue(
|
||||
) | rpl::start_with_next([=](bool toggled) {
|
||||
) | rpl::on_next([=](bool toggled) {
|
||||
if (toggled && !boostsUnrestrict->current()) {
|
||||
*boostsUnrestrict = 1;
|
||||
} else if (!toggled && boostsUnrestrict->current()) {
|
||||
|
||||
Reference in New Issue
Block a user