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

View File

@@ -113,7 +113,7 @@ ColorPicker::ColorPicker(
_down.pos = QPoint(colorToPosition(savedBrush.color), 0);
_colorLine->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_colorLine);
PainterHighQualityEnabler hq(p);
@@ -125,13 +125,13 @@ ColorPicker::ColorPicker(
}, _colorLine->lifetime());
_canvasForCircle->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_canvasForCircle);
paintCircle(p);
}, _canvasForCircle->lifetime());
_colorLine->events(
) | rpl::start_with_next([=](not_null<QEvent*> event) {
) | rpl::on_next([=](not_null<QEvent*> event) {
const auto type = event->type();
const auto isPress = (type == QEvent::MouseButtonPress)
|| (type == QEvent::MouseButtonDblClick);

View File

@@ -60,7 +60,7 @@ void StickersPanelController::setShowRequestChanges(
rpl::producer<ShowRequest> &&showRequest) {
std::move(
showRequest
) | rpl::start_with_next([=](ShowRequest show) {
) | rpl::on_next([=](ShowRequest show) {
if (show == ShowRequest::ToggleAnimated) {
_stickersPanel->toggleAnimated();
_stickersPanel->raise();
@@ -79,7 +79,7 @@ void StickersPanelController::setMoveRequestChanges(
rpl::producer<QPoint> &&moveRequest) {
std::move(
moveRequest
) | rpl::start_with_next([=](const QPoint &point) {
) | rpl::on_next([=](const QPoint &point) {
_stickersPanel->moveBottomRight(
point.y(),
point.x() + _stickersPanel->width() / 2);

View File

@@ -79,7 +79,7 @@ Crop::Crop(
setMouseTracking(true);
paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(this);
p.fillPath(_painterPath, st::photoCropFadeBg);

View File

@@ -59,7 +59,7 @@ LayerWidget::LayerWidget(
_content->show();
paintRequest(
) | rpl::start_with_next([=](const QRect &clip) {
) | rpl::on_next([=](const QRect &clip) {
auto p = QPainter(this);
const auto faded = _backgroundFade.value(1.);
if (faded < 1.) {
@@ -83,12 +83,12 @@ void LayerWidget::start() {
_background = ProcessBackground(renderBackground(), _backgroundNight);
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
checkBackgroundStale();
_content->resize(size);
}, lifetime());
style::PaletteChanged() | rpl::start_with_next([=] {
style::PaletteChanged() | rpl::on_next([=] {
checkBackgroundStale();
}, lifetime());
}

View File

@@ -64,7 +64,7 @@ Paint::Paint(
// Undo / Redo.
controllers->undoController->performRequestChanges(
) | rpl::start_with_next([=](const Undo &command) {
) | rpl::on_next([=](const Undo &command) {
if (command == Undo::Undo) {
_scene->performUndo();
} else {
@@ -97,7 +97,7 @@ Paint::Paint(
) | rpl::map_to(ShowRequest::HideAnimated));
controllers->stickersPanelController->stickerChosen(
) | rpl::start_with_next([=](not_null<DocumentData*> document) {
) | rpl::on_next([=](not_null<DocumentData*> document) {
const auto item = std::make_shared<ItemSticker>(
document,
itemBaseData());
@@ -112,13 +112,13 @@ Paint::Paint(
) | rpl::to_empty
: rpl::never<>() | rpl::type_erased,
_scene->addsItem()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
clearRedoList();
updateUndoState();
}, lifetime());
_scene->removesItem(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateUndoState();
}, lifetime());

View File

@@ -96,7 +96,7 @@ PhotoEditor::PhotoEditor(
Deserialize(Core::App().settings().photoEditorBrush()))) {
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
if (size.isEmpty()) {
return;
}
@@ -104,7 +104,7 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_content->innerRect(
) | rpl::start_with_next([=](QRect inner) {
) | rpl::on_next([=](QRect inner) {
if (inner.isEmpty()) {
return;
}
@@ -116,23 +116,23 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_controls->colorLinePositionValue(
) | rpl::start_with_next([=](const QPoint &p) {
) | rpl::on_next([=](const QPoint &p) {
_colorPicker->moveLine(p);
}, _controls->lifetime());
_controls->colorLineShownValue(
) | rpl::start_with_next([=](bool shown) {
) | rpl::on_next([=](bool shown) {
_colorPicker->setVisible(shown);
}, _controls->lifetime());
_mode.value(
) | rpl::start_with_next([=](const PhotoEditorMode &mode) {
) | rpl::on_next([=](const PhotoEditorMode &mode) {
_content->applyMode(mode);
_controls->applyMode(mode);
}, lifetime());
_controls->rotateRequests(
) | rpl::start_with_next([=](int angle) {
) | rpl::on_next([=](int angle) {
_modifications.angle += 90;
if (_modifications.angle >= 360) {
_modifications.angle -= 360;
@@ -141,13 +141,13 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_controls->flipRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_modifications.flipped = !_modifications.flipped;
_content->applyModifications(_modifications);
}, lifetime());
_controls->paintModeRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_mode = PhotoEditorMode{
.mode = PhotoEditorMode::Mode::Paint,
.action = PhotoEditorMode::Action::None,
@@ -155,7 +155,7 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_controls->doneRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto mode = _mode.current().mode;
if (mode == PhotoEditorMode::Mode::Paint) {
_mode = PhotoEditorMode{
@@ -172,7 +172,7 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_controls->cancelRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto mode = _mode.current().mode;
if (mode == PhotoEditorMode::Mode::Paint) {
_mode = PhotoEditorMode{
@@ -189,7 +189,7 @@ PhotoEditor::PhotoEditor(
}, lifetime());
_colorPicker->saveBrushRequests(
) | rpl::start_with_next([=](const Brush &brush) {
) | rpl::on_next([=](const Brush &brush) {
_content->applyBrush(brush);
const auto serialized = Serialize(brush);
@@ -224,13 +224,13 @@ void InitEditorLayer(
not_null<PhotoEditor*> editor,
Fn<void(PhotoModifications)> doneCallback) {
editor->cancelRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
layer->closeLayer();
}, editor->lifetime());
const auto weak = base::make_weak(layer.get());
editor->doneRequests(
) | rpl::start_with_next([=, done = std::move(doneCallback)](
) | rpl::on_next([=, done = std::move(doneCallback)](
const PhotoModifications &mods) {
done(mods);
if (const auto strong = weak.get()) {

View File

@@ -42,7 +42,7 @@ PhotoEditorContent::PhotoEditorContent(
rpl::combine(
_modifications.value(),
sizeValue()
) | rpl::start_with_next([=](
) | rpl::on_next([=](
const PhotoModifications &mods, const QSize &size) {
if (size.isEmpty()) {
return;
@@ -85,7 +85,7 @@ PhotoEditorContent::PhotoEditorContent(
}, lifetime());
paintRequest(
) | rpl::start_with_next([=](const QRect &clip) {
) | rpl::on_next([=](const QRect &clip) {
auto p = QPainter(this);
p.fillRect(clip, Qt::transparent);

View File

@@ -72,7 +72,7 @@ void EdgeButton::init() {
// const auto bg = rounded(_bg);
paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
Painter p(this);
// p.drawImage(QPoint(), bg);
@@ -122,7 +122,7 @@ ButtonBar::ButtonBar(
const style::color &bg)
: RpWidget(parent) {
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
const auto children = RpWidget::children();
const auto widgets = ranges::views::all(
children
@@ -181,7 +181,7 @@ ButtonBar::ButtonBar(
}, lifetime());
paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(this);
p.drawImage(QPoint(), _roundedBg);
}, lifetime());
@@ -269,7 +269,7 @@ PhotoEditorControls::PhotoEditorControls(
_paintModeButtonActive->setAttribute(Qt::WA_TransparentForMouseEvents);
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
if (size.isEmpty()) {
return;
}
@@ -304,7 +304,7 @@ PhotoEditorControls::PhotoEditorControls(
}, lifetime());
_mode.changes(
) | rpl::start_with_next([=](const PhotoEditorMode &mode) {
) | rpl::on_next([=](const PhotoEditorMode &mode) {
if (mode.mode == PhotoEditorMode::Mode::Out) {
return;
}
@@ -316,7 +316,7 @@ PhotoEditorControls::PhotoEditorControls(
}, lifetime());
_paintBottomButtons->positionValue(
) | rpl::start_with_next([=](const QPoint &containerPos) {
) | rpl::on_next([=](const QPoint &containerPos) {
_paintTopButtons->moveToLeft(
containerPos.x(),
containerPos.y()
@@ -325,7 +325,7 @@ PhotoEditorControls::PhotoEditorControls(
}, _paintBottomButtons->lifetime());
_paintBottomButtons->shownValue(
) | rpl::start_with_next([=](bool shown) {
) | rpl::on_next([=](bool shown) {
_paintTopButtons->setVisible(shown);
}, _paintBottomButtons->lifetime());
@@ -350,7 +350,7 @@ PhotoEditorControls::PhotoEditorControls(
})));
controllers->undoController->canPerformChanges(
) | rpl::start_with_next([=](const UndoController::EnableRequest &r) {
) | rpl::on_next([=](const UndoController::EnableRequest &r) {
const auto isUndo = (r.command == Undo::Undo);
const auto &button = isUndo ? _undoButton : _redoButton;
button->setAttribute(Qt::WA_TransparentForMouseEvents, !r.enable);
@@ -385,7 +385,7 @@ PhotoEditorControls::PhotoEditorControls(
}));
controllers->stickersPanelController->panelShown(
) | rpl::start_with_next([=](bool shown) {
) | rpl::on_next([=](bool shown) {
const auto icon = shown
? &st::photoEditorStickersIconActive
: nullptr;
@@ -397,7 +397,7 @@ PhotoEditorControls::PhotoEditorControls(
modifications.flipped ? 0 : 1
) | rpl::then(
_flipButton->clicks() | rpl::to_empty
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_flipped = !_flipped;
const auto icon = _flipped ? &st::photoEditorFlipIconActive : nullptr;
_flipButton->setIconOverride(icon, icon);

View File

@@ -33,7 +33,7 @@ Scene::Scene(const QRectF &rect)
_canvas->clearPixmap();
_canvas->grabContentRequests(
) | rpl::start_with_next([=](ItemCanvas::Content &&content) {
) | rpl::on_next([=](ItemCanvas::Content &&content) {
const auto item = std::make_shared<ItemLine>(
std::move(content.pixmap));
item->setPos(content.position);

View File

@@ -46,7 +46,7 @@ ItemSticker::ItemSticker(
* style::DevicePixelRatio(),
Lottie::Quality::High);
_lottie.player->updates(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updatePixmap(_lottie.player->frame());
_lottie.player = nullptr;
_lottie.lifetime.destroy();
@@ -85,7 +85,7 @@ ItemSticker::ItemSticker(
};
if (!updateThumbnail()) {
_document->session().downloaderTaskFinished(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (updateThumbnail()) {
_loadingLifetime.destroy();
update();