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

@@ -207,7 +207,7 @@ void ListController::prepare() {
session().changes().peerUpdates(
Data::PeerUpdate::Flag::GroupCall
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
) | rpl::on_next([=](const Data::PeerUpdate &update) {
processPeer(update.peer);
finishProcess();
}, lifetime());
@@ -493,7 +493,7 @@ Main::Session &BoxController::session() const {
void BoxController::prepare() {
session().data().itemRemoved(
) | rpl::start_with_next([=](not_null<const HistoryItem*> item) {
) | rpl::on_next([=](not_null<const HistoryItem*> item) {
if (const auto row = rowForItem(item)) {
row->itemRemoved(item);
if (!row->hasItems()) {
@@ -511,7 +511,7 @@ void BoxController::prepare() {
) | rpl::filter([=](const Data::MessageUpdate &update) {
const auto media = update.item->media();
return (media != nullptr) && (media->call() != nullptr);
}) | rpl::start_with_next([=](const Data::MessageUpdate &update) {
}) | rpl::on_next([=](const Data::MessageUpdate &update) {
insertRow(update.item, InsertWay::Prepend);
}, lifetime());
@@ -790,7 +790,7 @@ void ClearCallsBox(
st::inviteViaLinkIcon,
QPoint());
result->heightValue(
) | rpl::start_with_next([=](int height) {
) | rpl::on_next([=](int height) {
icon->moveToLeft(
st::inviteViaLinkIconPosition.x(),
(height - st::inviteViaLinkIcon.height()) / 2);
@@ -846,7 +846,7 @@ void ShowCallsBox(not_null<::Window::SessionController*> window) {
button->events(
) | rpl::filter([=](not_null<QEvent*> e) {
return (e->type() == QEvent::Enter);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
state->callsDelegate.peerListMouseLeftGeometry();
}, button->lifetime());
@@ -858,7 +858,7 @@ void ShowCallsBox(not_null<::Window::SessionController*> window) {
box->setWidth(state->callsController.contentWidth());
state->callsController.boxHeightValue(
) | rpl::start_with_next([=](int height) {
) | rpl::on_next([=](int height) {
box->setMinHeight(height);
}, box->lifetime());
box->setTitle(tr::lng_call_box_title());

View File

@@ -530,7 +530,7 @@ void Call::setupMediaDevices() {
_playbackDeviceId.changes() | rpl::filter([=] {
return _instance && _setDeviceIdCallback;
}) | rpl::start_with_next([=](const Webrtc::DeviceResolvedId &deviceId) {
}) | rpl::on_next([=](const Webrtc::DeviceResolvedId &deviceId) {
_setDeviceIdCallback(deviceId);
// Value doesn't matter here, just trigger reading of the new value.
@@ -539,7 +539,7 @@ void Call::setupMediaDevices() {
_captureDeviceId.changes() | rpl::filter([=] {
return _instance && _setDeviceIdCallback;
}) | rpl::start_with_next([=](const Webrtc::DeviceResolvedId &deviceId) {
}) | rpl::on_next([=](const Webrtc::DeviceResolvedId &deviceId) {
_setDeviceIdCallback(deviceId);
// Value doesn't matter here, just trigger reading of the new value.
@@ -557,7 +557,7 @@ void Call::setupOutgoingVideo() {
_videoOutgoing->setState(Webrtc::VideoState::Inactive);
}
_videoOutgoing->stateValue(
) | rpl::start_with_next([=](Webrtc::VideoState state) {
) | rpl::on_next([=](Webrtc::VideoState state) {
if (state != Webrtc::VideoState::Inactive
&& cameraId().isEmpty()
&& !_videoCaptureIsScreencast) {
@@ -598,7 +598,7 @@ void Call::setupOutgoingVideo() {
_cameraDeviceId.changes(
) | rpl::filter([=] {
return !_videoCaptureIsScreencast;
}) | rpl::start_with_next([=](Webrtc::DeviceResolvedId deviceId) {
}) | rpl::on_next([=](Webrtc::DeviceResolvedId deviceId) {
const auto &id = deviceId.value;
_videoCaptureDeviceId = id;
if (_videoCapture) {
@@ -822,7 +822,7 @@ bool Call::handleUpdate(const MTPPhoneCall &call) {
box->sends(
) | rpl::take(
1 // Instead of keeping requestId.
) | rpl::start_with_next([=](const Ui::RateCallBox::Result &r) {
) | rpl::on_next([=](const Ui::RateCallBox::Result &r) {
sender->request(MTPphone_SetCallRating(
MTP_flags(0),
MTP_inputPhoneCall(
@@ -1196,7 +1196,7 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
raw->setIncomingVideoOutput(_videoIncoming->sink());
raw->setAudioOutputDuckingEnabled(settings.callAudioDuckingEnabled());
_state.value() | rpl::start_with_next([=](State state) {
_state.value() | rpl::on_next([=](State state) {
const auto track = (state != State::FailedHangingUp)
&& (state != State::Failed)
&& (state != State::HangingUp)
@@ -1207,13 +1207,13 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
Core::App().mediaDevices().setCaptureMuteTracker(this, track);
}, _instanceLifetime);
_muted.value() | rpl::start_with_next([=](bool muted) {
_muted.value() | rpl::on_next([=](bool muted) {
Core::App().mediaDevices().setCaptureMuted(muted);
}, _instanceLifetime);
#if 0
Core::App().batterySaving().value(
) | rpl::start_with_next([=](bool isSaving) {
) | rpl::on_next([=](bool isSaving) {
crl::on_main(weak, [=] {
if (_instance) {
_instance->setIsLowBatteryLevel(isSaving);

View File

@@ -150,7 +150,7 @@ void WebrtcController::setOnStateUpdated(
Fn<void(TgVoipState)> onStateUpdated) {
_stateUpdatedLifetime.destroy();
_impl->state().changes(
) | rpl::start_with_next([=](CallState state) {
) | rpl::on_next([=](CallState state) {
onStateUpdated([&] {
switch (state) {
case CallState::Initializing: return TgVoipState::WaitInit;

View File

@@ -205,7 +205,7 @@ base::unique_qptr<Ui::RpWidget> CreateFingerprintAndSignalBars(
call->user()->name()));
raw->setMouseTracking(true);
raw->events(
) | rpl::start_with_next([=](not_null<QEvent*> e) {
) | rpl::on_next([=](not_null<QEvent*> e) {
if (e->type() == QEvent::MouseMove) {
Ui::Tooltip::Show(kTooltipShowTimeoutMs, shower);
} else if (e->type() == QEvent::Leave) {
@@ -254,7 +254,7 @@ base::unique_qptr<Ui::RpWidget> CreateFingerprintAndSignalBars(
rpl::single(rpl::empty),
Ui::Emoji::Updated(),
style::PaletteChanged()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
background->fill(Qt::transparent);
// Prepare.
@@ -300,7 +300,7 @@ base::unique_qptr<Ui::RpWidget> CreateFingerprintAndSignalBars(
}, raw->lifetime());
raw->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
QPainter(raw).drawImage(raw->rect(), *background);
}, raw->lifetime());
@@ -522,7 +522,7 @@ FingerprintBadge SetupFingerprintBadge(
std::move(
fingerprint
) | rpl::start_with_next([=](const QByteArray &fingerprint) {
) | rpl::on_next([=](const QByteArray &fingerprint) {
auto buffered = base::BufferedRandom<uint32>(
kEmojiInCarousel * kEmojiInFingerprint);
const auto now = crl::now();
@@ -615,7 +615,7 @@ void SetupFingerprintTooltip(not_null<Ui::RpWidget*> widget) {
raw->toggleAnimated(true);
};
widget->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
widget->events() | rpl::on_next([=](not_null<QEvent*> e) {
const auto type = e->type();
if (type == QEvent::Enter) {
// Enter events may come from widget destructors,
@@ -681,7 +681,7 @@ void SetupFingerprintBadgeWidget(
const auto ratio = style::DevicePixelRatio();
const auto esize = Ui::Emoji::GetSizeNormal();
const auto size = esize / ratio;
widget->widthValue() | rpl::start_with_next([=](int width) {
widget->widthValue() | rpl::on_next([=](int width) {
static_assert(!(kEmojiInFingerprint % 2));
const auto available = width
@@ -729,7 +729,7 @@ void SetupFingerprintBadgeWidget(
}, lifetime);
const auto cache = lifetime.make_state<FingerprintBadgeCache>();
button->paintRequest() | rpl::start_with_next([=] {
button->paintRequest() | rpl::on_next([=] {
auto p = QPainter(button);
const auto outer = button->rect();
@@ -770,7 +770,7 @@ void SetupFingerprintBadgeWidget(
}
}, lifetime);
std::move(repaints) | rpl::start_with_next([=] {
std::move(repaints) | rpl::on_next([=] {
button->update();
}, lifetime);

View File

@@ -259,7 +259,7 @@ void Instance::startOrJoinConferenceCall(StartConferenceInfo args) {
const auto raw = call.get();
session->account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
destroyGroupCall(raw);
}, raw->lifetime());
@@ -432,7 +432,7 @@ void Instance::createCall(
const auto raw = call.get();
user->session().account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
destroyCall(raw);
}, raw->lifetime());
@@ -446,7 +446,7 @@ void Instance::createCall(
}
if (raw->state() == Call::State::WaitingUserConfirmation) {
_currentCallPanel->startOutgoingRequests(
) | rpl::start_with_next([=](bool video) {
) | rpl::on_next([=](bool video) {
repeater.callback(video, true, repeater);
}, raw->lifetime());
} else {
@@ -488,7 +488,7 @@ void Instance::createGroupCall(
const auto raw = call.get();
info.peer->session().account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
destroyGroupCall(raw);
}, raw->lifetime());
@@ -1182,7 +1182,7 @@ void Instance::showConferenceInvite(
const auto raw = call.get();
user->session().account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
destroyCall(raw);
}, raw->lifetime());

View File

@@ -273,7 +273,7 @@ void Panel::initWindow() {
: Flag::None;
});
_window->maximizeRequests() | rpl::start_with_next([=](bool maximized) {
_window->maximizeRequests() | rpl::on_next([=](bool maximized) {
toggleFullScreen(maximized);
}, lifetime());
// Don't do that, it looks awful :(
@@ -307,12 +307,12 @@ void Panel::initWidget() {
widget()->setMouseTracking(true);
widget()->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
paint(clip);
}, lifetime());
widget()->sizeValue(
) | rpl::skip(1) | rpl::start_with_next([=] {
) | rpl::skip(1) | rpl::on_next([=] {
updateControlsGeometry();
}, lifetime());
}
@@ -467,7 +467,7 @@ void Panel::initConferenceInvite() {
+ padding.right();
const auto height = add + userpics->height() + add;
_status->geometryValue() | rpl::start_with_next([=] {
_status->geometryValue() | rpl::on_next([=] {
const auto top = _bodyTop + _bodySt->participantsTop;
const auto left = (widget()->width() - width) / 2;
raw->setGeometry(left, top, width, height);
@@ -475,7 +475,7 @@ void Panel::initConferenceInvite() {
label->move(add + userpics->width() + padding.left(), padding.top());
}, raw->lifetime());
raw->paintRequest() | rpl::start_with_next([=] {
raw->paintRequest() | rpl::on_next([=] {
auto p = QPainter(raw);
auto hq = PainterHighQualityEnabler(p);
const auto radius = raw->height() / 2.;
@@ -579,7 +579,7 @@ void Panel::reinitWithCall(Call *call) {
});
_call->confereceSupportedValue(
) | rpl::start_with_next([=](bool supported) {
) | rpl::on_next([=](bool supported) {
_conferenceSupported = supported;
_addPeople->toggle(_conferenceSupported
&& (_call->state() != State::WaitingUserConfirmation),
@@ -592,7 +592,7 @@ void Panel::reinitWithCall(Call *call) {
) | rpl::map(rpl::mappers::_1 == Call::RemoteAudioState::Muted);
rpl::duplicate(
remoteMuted
) | rpl::start_with_next([=](bool muted) {
) | rpl::on_next([=](bool muted) {
if (muted) {
createRemoteAudioMute();
} else {
@@ -601,7 +601,7 @@ void Panel::reinitWithCall(Call *call) {
}
}, _callLifetime);
_call->remoteBatteryStateValue(
) | rpl::start_with_next([=](Call::RemoteBatteryState state) {
) | rpl::on_next([=](Call::RemoteBatteryState state) {
if (state == Call::RemoteBatteryState::Low) {
createRemoteLowBattery();
} else {
@@ -621,13 +621,13 @@ void Panel::reinitWithCall(Call *call) {
_window->backend());
_incoming->widget()->hide();
_incoming->rp()->shownValue() | rpl::start_with_next([=] {
_incoming->rp()->shownValue() | rpl::on_next([=] {
updateControlsShown();
}, _incoming->rp()->lifetime());
_hideControlsFilter = nullptr;
_fullScreenOrMaximized.value(
) | rpl::start_with_next([=](bool fullScreenOrMaximized) {
) | rpl::on_next([=](bool fullScreenOrMaximized) {
if (fullScreenOrMaximized) {
class Filter final : public QObject {
public:
@@ -667,7 +667,7 @@ void Panel::reinitWithCall(Call *call) {
}, _incoming->rp()->lifetime());
_call->mutedValue(
) | rpl::start_with_next([=](bool mute) {
) | rpl::on_next([=](bool mute) {
_mute->entity()->setProgress(mute ? 1. : 0.);
_mute->entity()->setText(mute
? tr::lng_call_unmute_audio()
@@ -675,7 +675,7 @@ void Panel::reinitWithCall(Call *call) {
}, _callLifetime);
_call->videoOutgoing()->stateValue(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
{
const auto active = _call->isSharingCamera();
_camera->setProgress(active ? 0. : 1.);
@@ -692,12 +692,12 @@ void Panel::reinitWithCall(Call *call) {
}, _callLifetime);
_call->stateValue(
) | rpl::start_with_next([=](State state) {
) | rpl::on_next([=](State state) {
stateChanged(state);
}, _callLifetime);
_call->videoIncoming()->renderNextFrame(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto track = _call->videoIncoming();
setIncomingSize(track->state() == Webrtc::VideoState::Active
? track->frameSize()
@@ -714,14 +714,14 @@ void Panel::reinitWithCall(Call *call) {
}, _callLifetime);
_call->videoIncoming()->stateValue(
) | rpl::start_with_next([=](Webrtc::VideoState state) {
) | rpl::on_next([=](Webrtc::VideoState state) {
setIncomingSize((state == Webrtc::VideoState::Active)
? _call->videoIncoming()->frameSize()
: QSize());
}, _callLifetime);
_call->videoOutgoing()->renderNextFrame(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto incoming = incomingFrameGeometry();
const auto outgoing = outgoingFrameGeometry();
widget()->update(outgoing);
@@ -735,7 +735,7 @@ void Panel::reinitWithCall(Call *call) {
rpl::single(
rpl::empty_value()
) | rpl::then(_call->videoOutgoing()->renderNextFrame())
) | rpl::start_with_next([=](State state, auto) {
) | rpl::on_next([=](State state, auto) {
if (state != State::Ended
&& state != State::EndedByOtherDevice
&& state != State::Failed
@@ -747,7 +747,7 @@ void Panel::reinitWithCall(Call *call) {
}, _callLifetime);
_call->errors(
) | rpl::start_with_next([=](Error error) {
) | rpl::on_next([=](Error error) {
const auto text = [=] {
switch (error.type) {
case ErrorType::NoCamera:
@@ -802,7 +802,7 @@ void Panel::createRemoteAudioMute() {
_remoteAudioMute->setAttribute(Qt::WA_TransparentForMouseEvents);
_remoteAudioMute->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_remoteAudioMute);
const auto r = _remoteAudioMute->rect();
@@ -839,7 +839,7 @@ void Panel::createRemoteLowBattery() {
_remoteLowBattery->setAttribute(Qt::WA_TransparentForMouseEvents);
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_remoteLowBattery = nullptr;
createRemoteLowBattery();
}, _remoteLowBattery->lifetime());
@@ -865,7 +865,7 @@ void Panel::createRemoteLowBattery() {
}();
_remoteLowBattery->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_remoteLowBattery);
const auto r = _remoteLowBattery->rect();
@@ -905,7 +905,7 @@ void Panel::initLayout() {
) | rpl::filter([=](const Data::PeerUpdate &update) {
// _user may change for the same Panel.
return (_call != nullptr) && (update.peer == _user);
}) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
}) | rpl::on_next([=](const Data::PeerUpdate &update) {
_name->setText(_call->user()->name());
updateControlsGeometry();
}, lifetime());

View File

@@ -34,7 +34,7 @@ PanelBackground::PanelBackground(
_peer,
Data::PeerUpdate::Flag::ColorProfile
| Data::PeerUpdate::Flag::EmojiStatus
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateColors();
_brushSize = QSize();
if (_updateCallback) {
@@ -46,7 +46,7 @@ PanelBackground::PanelBackground(
_peer,
Data::PeerUpdate::Flag::BackgroundEmoji
| Data::PeerUpdate::Flag::EmojiStatus
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateEmojiId();
if (_updateCallback) {
_updateCallback();

View File

@@ -24,7 +24,7 @@ SignalBars::SignalBars(
_st.width + (_st.width + _st.skip) * (Call::kSignalBarCount - 1),
_st.max);
call->signalBarCountValue(
) | rpl::start_with_next([=](int count) {
) | rpl::on_next([=](int count) {
changed(count);
}, lifetime());
}

View File

@@ -186,7 +186,7 @@ public:
installEventFilter(this);
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_crossLineMuteAnimation.invalidate();
}, lifetime());
}
@@ -339,7 +339,7 @@ void TopBar::initControls() {
muted
) | rpl::map(
BarStateFromMuteState
) | rpl::start_with_next([=](BarState state) {
) | rpl::on_next([=](BarState state) {
_isGroupConnecting = (state == BarState::Connecting);
setMuted(state != BarState::Active);
update();
@@ -387,7 +387,7 @@ void TopBar::initControls() {
subscribeToMembersChanges(group);
_isGroupConnecting.value(
) | rpl::start_with_next([=](bool isConnecting) {
) | rpl::on_next([=](bool isConnecting) {
_mute->setAttribute(
Qt::WA_TransparentForMouseEvents,
isConnecting);
@@ -401,7 +401,7 @@ void TopBar::initControls() {
) | rpl::filter([=](const Data::PeerUpdate &update) {
// _user may change for the same Panel.
return (_call != nullptr) && (update.peer == _call->user());
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
updateInfoLabels();
}, lifetime());
}
@@ -491,7 +491,7 @@ void TopBar::initBlobsUnder(
});
group->stateValue(
) | rpl::start_with_next([=](Calls::GroupCall::State state) {
) | rpl::on_next([=](Calls::GroupCall::State state) {
if (state == Calls::GroupCall::State::HangingUp) {
_blobs->hide();
}
@@ -507,7 +507,7 @@ void TopBar::initBlobsUnder(
std::move(
hideBlobs
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool hide) {
) | rpl::on_next([=](bool hide) {
if (hide) {
state->paint.setLevel(0.);
}
@@ -530,7 +530,7 @@ void TopBar::initBlobsUnder(
std::move(
barGeometry
) | rpl::start_with_next([=](QRect rect) {
) | rpl::on_next([=](QRect rect) {
_blobs->resize(
rect.width(),
(int)state->paint.maxRadius());
@@ -538,12 +538,12 @@ void TopBar::initBlobsUnder(
}, lifetime());
shownValue(
) | rpl::start_with_next([=](bool shown) {
) | rpl::on_next([=](bool shown) {
_blobs->setVisible(shown);
}, lifetime());
_blobs->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
const auto hidden = state->hideAnimation.value(
state->hideLastTime ? 1. : 0.);
if (hidden == 1.) {
@@ -563,7 +563,7 @@ void TopBar::initBlobsUnder(
group->levelUpdates(
) | rpl::filter([=](const LevelUpdate &update) {
return !state->hideLastTime && (update.value > state->lastLevel);
}) | rpl::start_with_next([=](const LevelUpdate &update) {
}) | rpl::on_next([=](const LevelUpdate &update) {
if (state->lastLevel == 0.) {
state->levelTimer.callEach(kBlobUpdateInterval);
}
@@ -597,7 +597,7 @@ void TopBar::subscribeToMembersChanges(not_null<GroupCall*> call) {
std::move(
realValue
) | rpl::before_next([=](not_null<Data::GroupCall*> real) {
real->titleValue() | rpl::start_with_next([=] {
real->titleValue() | rpl::on_next([=] {
updateInfoLabels();
}, lifetime());
}) | rpl::map([=](not_null<Data::GroupCall*> real) {
@@ -617,7 +617,7 @@ void TopBar::subscribeToMembersChanges(not_null<GroupCall*> call) {
}
}
return false;
}) | rpl::start_with_next([=](const Ui::GroupCallBarContent &content) {
}) | rpl::on_next([=](const Ui::GroupCallBarContent &content) {
_users = content.users;
_usersCount = content.count;
for (auto &user : _users) {
@@ -630,7 +630,7 @@ void TopBar::subscribeToMembersChanges(not_null<GroupCall*> call) {
}, lifetime());
_userpics->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
_userpicsWidth = width;
updateControlsGeometry();
}, lifetime());
@@ -641,7 +641,7 @@ void TopBar::subscribeToMembersChanges(not_null<GroupCall*> call) {
// _peer may change for the same Panel.
const auto call = _groupCall.get();
return (call != nullptr) && (update.peer == call->peer());
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
updateInfoLabels();
}, lifetime());
}

View File

@@ -58,25 +58,25 @@ void Userpic::setup(rpl::producer<bool> muted) {
_content.setAttribute(Qt::WA_TransparentForMouseEvents);
_content.paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
paint();
}, lifetime());
std::move(
muted
) | rpl::start_with_next([=](bool muted) {
) | rpl::on_next([=](bool muted) {
setMuted(muted);
}, lifetime());
_peer->session().changes().peerFlagsValue(
_peer,
Data::PeerUpdate::Flag::Photo
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
processPhoto();
}, lifetime());
_peer->session().downloaderTaskFinished(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshPhoto();
}, lifetime());

View File

@@ -30,17 +30,17 @@ void VideoBubble::setup() {
applyDragMode(_dragMode);
_content.paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
paint();
}, lifetime());
_track->stateValue(
) | rpl::start_with_next([=](Webrtc::VideoState state) {
) | rpl::on_next([=](Webrtc::VideoState state) {
setState(state);
}, lifetime());
_track->renderNextFrame(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (_track->frameSize().isEmpty()) {
_track->markFrameShown();
} else {

View File

@@ -114,7 +114,7 @@ private:
Panel::Incoming::RendererGL::RendererGL(not_null<Incoming*> owner)
: _owner(owner) {
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_controlsShadowImage.invalidate();
}, _lifetime);
}

View File

@@ -352,7 +352,7 @@ void ChooseJoinAsProcess::start(
createRequest();
session->account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_request = nullptr;
}, _request->lifetime);
@@ -476,7 +476,7 @@ void ChooseJoinAsProcess::processList(
.labelFilter = filter,
});
box->boxClosing(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_request = nullptr;
}, _request->lifetime);
@@ -490,7 +490,7 @@ void ChooseJoinAsProcess::processList(
std::move(info),
crl::guard(&_request->guard, [=](auto info) { finish(info); }));
box->boxClosing(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_request = nullptr;
}, _request->lifetime);

View File

@@ -38,7 +38,7 @@ CoverItem::CoverItem(
_cover.widget()->move(0, 0);
_cover.moveRequests(
) | rpl::start_with_next(userpic.move, lifetime());
) | rpl::on_next(userpic.move, lifetime());
}
not_null<QAction*> CoverItem::action() const {

View File

@@ -635,7 +635,7 @@ GroupCall::GroupCall(
_muted.value(
) | rpl::combine_previous(
) | rpl::start_with_next([=](MuteState previous, MuteState state) {
) | rpl::on_next([=](MuteState previous, MuteState state) {
if (_instance) {
updateInstanceMuteState();
}
@@ -649,7 +649,7 @@ GroupCall::GroupCall(
_instanceState.value(
) | rpl::filter([=] {
return _hadJoinedState;
}) | rpl::start_with_next([=](InstanceState state) {
}) | rpl::on_next([=](InstanceState state) {
if (state == InstanceState::Disconnected) {
playConnectingSound();
} else {
@@ -676,7 +676,7 @@ GroupCall::GroupCall(
return not_null{ real };
}) | rpl::take(
1
) | rpl::start_with_next([=](not_null<Data::GroupCall*> real) {
) | rpl::on_next([=](not_null<Data::GroupCall*> real) {
subscribeToReal(real);
_realChanges.fire_copy(real);
}, _lifetime);
@@ -769,16 +769,16 @@ void GroupCall::initConferenceE2E() {
_e2e = std::make_unique<TdE2E::Call>(tde2eUserId);
_e2e->subchainRequests(
) | rpl::start_with_next([=](TdE2E::Call::SubchainRequest request) {
) | rpl::on_next([=](TdE2E::Call::SubchainRequest request) {
requestSubchainBlocks(request.subchain, request.height);
}, _e2e->lifetime());
_e2e->sendOutboundBlock(
) | rpl::start_with_next([=](QByteArray &&block) {
) | rpl::on_next([=](QByteArray &&block) {
sendOutboundBlock(std::move(block));
}, _e2e->lifetime());
_e2e->failures() | rpl::start_with_next([=] {
_e2e->failures() | rpl::on_next([=] {
LOG(("TdE2E: Got failure, scheduling rejoin!"));
crl::on_main(this, [=] { startRejoin(); });
}, _e2e->lifetime());
@@ -792,7 +792,7 @@ void GroupCall::setupConferenceCall() {
Expects(_sharedCall != nullptr);
_sharedCall->staleParticipantIds(
) | rpl::start_with_next([=](const base::flat_set<UserId> &staleIds) {
) | rpl::on_next([=](const base::flat_set<UserId> &staleIds) {
removeConferenceParticipants(staleIds, true);
}, _lifetime);
}
@@ -803,7 +803,7 @@ void GroupCall::trackParticipantsWithAccess() {
}
_e2e->participantsSetValue(
) | rpl::start_with_next([=](const TdE2E::ParticipantsSet &set) {
) | rpl::on_next([=](const TdE2E::ParticipantsSet &set) {
auto users = base::flat_set<UserId>();
users.reserve(set.list.size());
for (const auto &id : set.list) {
@@ -967,12 +967,12 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
_listenersHidden = real->listenersHidden();
real->scheduleDateValue(
) | rpl::start_with_next([=](TimeId date) {
) | rpl::on_next([=](TimeId date) {
setScheduledDate(date);
}, _lifetime);
real->messagesEnabledValue(
) | rpl::start_with_next([=](bool enabled) {
) | rpl::on_next([=](bool enabled) {
setMessagesEnabled(enabled);
}, _lifetime);
@@ -981,7 +981,7 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
Ui::PostponeCall(this, [=] {
if (const auto real = lookupReal()) {
real->participantsReloaded(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
fillActiveVideoEndpoints();
}, _lifetime);
fillActiveVideoEndpoints();
@@ -990,7 +990,7 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
using Update = Data::GroupCall::ParticipantUpdate;
real->participantUpdated(
) | rpl::start_with_next([=](const Update &data) {
) | rpl::on_next([=](const Update &data) {
const auto regularEndpoint = [&](const std::string &endpoint)
-> const std::string & {
return (endpoint.empty()
@@ -1067,7 +1067,7 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
}, _lifetime);
real->participantsResolved(
) | rpl::start_with_next([=](
) | rpl::on_next([=](
not_null<const base::flat_map<
uint32,
Data::LastSpokeTimes>*> ssrcs) {
@@ -1079,7 +1079,7 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
real->participantSpeaking(
) | rpl::filter([=] {
return _videoEndpointLarge.current();
}) | rpl::start_with_next([=](not_null<Data::GroupCallParticipant*> p) {
}) | rpl::on_next([=](not_null<Data::GroupCallParticipant*> p) {
const auto now = crl::now();
if (_videoEndpointLarge.current().peer == p->peer) {
_videoLargeTillTime = std::max(
@@ -1350,7 +1350,7 @@ void GroupCall::initialJoinRequested() {
real->participantUpdated(
) | rpl::filter([=](const Update &update) {
return (_instance != nullptr);
}) | rpl::start_with_next([=](const Update &update) {
}) | rpl::on_next([=](const Update &update) {
if (!update.now) {
_instance->removeSsrcs({
update.was->ssrc,
@@ -1472,7 +1472,7 @@ void GroupCall::markEndpointActive(
const auto track = &i->second->track;
track->renderNextFrame(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto activeTrack = _activeVideoTracks[endpoint].get();
const auto size = track->frameSize();
if (size.isEmpty()) {
@@ -1494,7 +1494,7 @@ void GroupCall::markEndpointActive(
) | rpl::filter([=](Webrtc::VideoState state) {
return (state == Webrtc::VideoState::Paused)
&& !_activeVideoTracks[endpoint]->shown;
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
_activeVideoTracks[endpoint]->shown = true;
markTrackShown(endpoint, true);
}, i->second->lifetime);
@@ -2671,7 +2671,7 @@ void GroupCall::applyOtherParticipantUpdate(
void GroupCall::setupMediaDevices() {
_playbackDeviceId.changes() | rpl::filter([=] {
return _instance && _setDeviceIdCallback;
}) | rpl::start_with_next([=](const Webrtc::DeviceResolvedId &deviceId) {
}) | rpl::on_next([=](const Webrtc::DeviceResolvedId &deviceId) {
_setDeviceIdCallback(deviceId);
// Value doesn't matter here, just trigger reading of the new value.
@@ -2680,7 +2680,7 @@ void GroupCall::setupMediaDevices() {
_captureDeviceId.changes() | rpl::filter([=] {
return _instance && _setDeviceIdCallback;
}) | rpl::start_with_next([=](const Webrtc::DeviceResolvedId &deviceId) {
}) | rpl::on_next([=](const Webrtc::DeviceResolvedId &deviceId) {
_setDeviceIdCallback(deviceId);
// Value doesn't matter here, just trigger reading of the new value.
@@ -2689,12 +2689,12 @@ void GroupCall::setupMediaDevices() {
_cameraDeviceId.changes() | rpl::filter([=] {
return _cameraCapture != nullptr;
}) | rpl::start_with_next([=](const Webrtc::DeviceResolvedId &deviceId) {
}) | rpl::on_next([=](const Webrtc::DeviceResolvedId &deviceId) {
_cameraCapture->switchToDevice(deviceId.value.toStdString(), false);
}, _lifetime);
if (!_rtmp) {
_muted.value() | rpl::start_with_next([=](MuteState state) {
_muted.value() | rpl::on_next([=](MuteState state) {
const auto devices = &Core::App().mediaDevices();
const auto muted = (state != MuteState::Active)
&& (state != MuteState::PushToTalk);
@@ -2804,7 +2804,7 @@ void GroupCall::setupOutgoingVideo() {
) | rpl::filter([=](VideoState previous, VideoState state) {
// Recursive entrance may happen if error happens when activating.
return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) {
}) | rpl::on_next([=](VideoState previous, VideoState state) {
const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive);
@@ -2860,7 +2860,7 @@ void GroupCall::setupOutgoingVideo() {
) | rpl::filter([=](VideoState previous, VideoState state) {
// Recursive entrance may happen if error happens when activating.
return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) {
}) | rpl::on_next([=](VideoState previous, VideoState state) {
const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive);

View File

@@ -86,7 +86,7 @@ object_ptr<Ui::RpWidget> MakeRoundActiveLogo(
auto result = object_ptr<Ui::RpWidget>(parent);
const auto logo = result.data();
logo->resize(logo->width(), logoOuter.height());
logo->paintRequest() | rpl::start_with_next([=, &icon] {
logo->paintRequest() | rpl::on_next([=, &icon] {
if (logo->width() < logoOuter.width()) {
return;
}
@@ -156,7 +156,7 @@ void ConferenceCallJoinConfirm(
object_ptr<Ui::RpWidget>(box),
st::boxRowPadding + st::confcallJoinSepPadding);
sep->resize(sep->width(), st::normalFont->height);
sep->paintRequest() | rpl::start_with_next([=] {
sep->paintRequest() | rpl::on_next([=] {
auto p = QPainter(sep);
const auto line = st::lineWidth;
const auto top = st::confcallLinkFooterOrLineTop;
@@ -323,7 +323,7 @@ void ShowConferenceCallLinkBox(
});
close->geometryValue(
) | rpl::start_with_next([=](QRect geometry) {
) | rpl::on_next([=](QRect geometry) {
toggle->moveToLeft(
geometry.x() - toggle->width(),
geometry.y());
@@ -380,7 +380,7 @@ void ShowConferenceCallLinkBox(
box->widthValue(),
copy->widthValue(),
share->widthValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
const auto width = st::boxWideWidth;
const auto padding = st::confcallLinkBox.buttonPadding;
const auto available = width - 2 * padding.right();
@@ -399,7 +399,7 @@ void ShowConferenceCallLinkBox(
copy->parentWidget(),
tr::lng_confcall_link_or(),
st::confcallLinkFooterOr);
sep->paintRequest() | rpl::start_with_next([=] {
sep->paintRequest() | rpl::on_next([=] {
auto p = QPainter(sep);
const auto text = sep->textMaxWidth();
const auto white = (sep->width() - 2 * text) / 2;
@@ -433,7 +433,7 @@ void ShowConferenceCallLinkBox(
}
return false;
});
copy->geometryValue() | rpl::start_with_next([=](QRect geometry) {
copy->geometryValue() | rpl::on_next([=](QRect geometry) {
const auto width = st::boxWideWidth
- st::boxRowPadding.left()
- st::boxRowPadding.right();

View File

@@ -51,7 +51,7 @@ namespace {
const auto raw = result.data();
raw->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
auto p = QPainter(raw);
p.fillRect(clip, st::groupCallMembersBgOver);
}, raw->lifetime());
@@ -61,7 +61,7 @@ namespace {
std::move(text),
st::groupCallBoxLabel);
raw->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
const auto padding = st::groupCallInviteDividerPadding;
const auto available = width - padding.left() - padding.right();
label->resizeToNaturalWidth(available);
@@ -412,7 +412,7 @@ void ConfInviteRow::elementsPaint(
const auto activate = [=] {
content->submitted();
};
content->noSearchSubmits() | rpl::start_with_next([=] {
content->noSearchSubmits() | rpl::on_next([=] {
controller->toggleFirst();
}, content->lifetime());
@@ -676,7 +676,7 @@ void ConfInviteController::addShareLinkButton() {
: st::createCallInviteLinkIcon),
QPoint());
button->entity()->heightValue(
) | rpl::start_with_next([=](int height) {
) | rpl::on_next([=](int height) {
icon->moveToLeft(
st::createCallInviteLinkIconPosition.x(),
(height - st::groupCallInviteLinkIcon.height()) / 2);
@@ -686,7 +686,7 @@ void ConfInviteController::addShareLinkButton() {
button->entity()->events(
) | rpl::filter([=](not_null<QEvent*> e) {
return (e->type() == QEvent::Enter);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
delegate()->peerListMouseLeftGeometry();
}, button->lifetime());
delegate()->peerListSetAboveWidget(std::move(button));
@@ -787,7 +787,7 @@ void InviteContactsController::prepareViewHook() {
std::move(
_discoveredInGroup
) | rpl::start_with_next([=](not_null<UserData*> user) {
) | rpl::on_next([=](not_null<UserData*> user) {
if (auto row = delegate()->peerListFindRow(user->id.value)) {
delegate()->peerListRemoveRow(row);
}
@@ -846,7 +846,7 @@ object_ptr<Ui::BoxContent> PrepareInviteBox(
&st::groupCallMultiSelect);
auto initBox = [=](not_null<PeerListBox*> box) {
box->setTitle(tr::lng_group_call_invite_conf());
raw->hasSelectedValue() | rpl::start_with_next([=](bool has) {
raw->hasSelectedValue() | rpl::on_next([=](bool has) {
box->clearButtons();
if (has) {
box->addButton(tr::lng_group_call_confcall_add(), [=] {
@@ -1018,7 +1018,7 @@ object_ptr<Ui::BoxContent> PrepareInviteBox(
&st::groupCallMultiSelect);
auto initBox = [=](not_null<PeerListBox*> box) {
box->setTitle(tr::lng_group_call_invite_conf());
raw->hasSelectedValue() | rpl::start_with_next([=](bool has) {
raw->hasSelectedValue() | rpl::on_next([=](bool has) {
box->clearButtons();
if (has) {
box->addButton(tr::lng_group_call_invite_button(), [=] {
@@ -1067,7 +1067,7 @@ void InitReActivate(not_null<PeerListBox*> box) {
const auto header = CreateReActivateHeader(box);
header->resizeToWidth(st::boxWideWidth);
header->heightValue() | rpl::start_with_next([=](int height) {
header->heightValue() | rpl::on_next([=](int height) {
box->setAddedTopScrollSkip(height, true);
}, header->lifetime());
header->moveToLeft(0, 0);
@@ -1088,12 +1088,12 @@ object_ptr<Ui::BoxContent> PrepareInviteToEmptyBox(
const auto initBox = [=](not_null<PeerListBox*> box) {
InitReActivate(box);
box->noSearchSubmits() | rpl::start_with_next([=] {
box->noSearchSubmits() | rpl::on_next([=] {
raw->noSearchSubmit();
}, box->lifetime());
raw->prioritizeScrollRequests(
) | rpl::start_with_next([=](Ui::ScrollToRequest request) {
) | rpl::on_next([=](Ui::ScrollToRequest request) {
box->scrollTo(request);
}, box->lifetime());
@@ -1171,12 +1171,12 @@ object_ptr<Ui::BoxContent> PrepareCreateCallBox(
box->setTitle(tr::lng_confcall_create_title());
}
box->noSearchSubmits() | rpl::start_with_next([=] {
box->noSearchSubmits() | rpl::on_next([=] {
raw->noSearchSubmit();
}, box->lifetime());
raw->prioritizeScrollRequests(
) | rpl::start_with_next([=](Ui::ScrollToRequest request) {
) | rpl::on_next([=](Ui::ScrollToRequest request) {
box->scrollTo(request);
}, box->lifetime());

View File

@@ -241,7 +241,7 @@ Members::Controller::Controller(
st::groupCallMembersBgOver)
, _narrowRoundRect(ImageRoundRadius::Large, st::groupCallMembersBg) {
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_inactiveCrossLine.invalidate();
_coloredCrossLine.invalidate();
_inactiveNarrowCrossLine.invalidate();
@@ -251,7 +251,7 @@ Members::Controller::Controller(
rpl::combine(
PowerSaving::OnValue(PowerSaving::kCalls),
Core::App().appDeactivatedValue()
) | rpl::start_with_next([=](bool disabled, bool deactivated) {
) | rpl::on_next([=](bool disabled, bool deactivated) {
const auto hide = disabled || deactivated;
if (!(hide && _soundingAnimationHideLastTime)) {
@@ -284,7 +284,7 @@ Members::Controller::Controller(
_peer->session().changes().peerUpdates(
Data::PeerUpdate::Flag::About
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
) | rpl::on_next([=](const Data::PeerUpdate &update) {
if (const auto row = findRow(update.peer)) {
row->setAbout(update.peer->about());
}
@@ -297,12 +297,12 @@ Members::Controller::~Controller() {
void Members::Controller::setupListChangeViewers() {
_call->real(
) | rpl::start_with_next([=](not_null<Data::GroupCall*> real) {
) | rpl::on_next([=](not_null<Data::GroupCall*> real) {
subscribeToChanges(real);
}, _lifetime);
_call->levelUpdates(
) | rpl::start_with_next([=](const LevelUpdate &update) {
) | rpl::on_next([=](const LevelUpdate &update) {
const auto i = _soundingRowBySsrc.find(update.ssrc);
if (i != end(_soundingRowBySsrc)) {
updateRowLevel(i->second, update.value);
@@ -310,7 +310,7 @@ void Members::Controller::setupListChangeViewers() {
}, _lifetime);
_call->videoEndpointLargeValue(
) | rpl::start_with_next([=](const VideoEndpoint &large) {
) | rpl::on_next([=](const VideoEndpoint &large) {
if (large) {
hideRowsWithVideoExcept(large);
} else {
@@ -322,7 +322,7 @@ void Members::Controller::setupListChangeViewers() {
) | rpl::filter([=](const VideoStateToggle &update) {
const auto &large = _call->videoEndpointLarge();
return large && (update.endpoint != large);
}) | rpl::start_with_next([=](const VideoStateToggle &update) {
}) | rpl::on_next([=](const VideoStateToggle &update) {
if (update.value) {
hideRowWithVideo(update.endpoint);
} else {
@@ -331,7 +331,7 @@ void Members::Controller::setupListChangeViewers() {
}, _lifetime);
_call->rejoinEvents(
) | rpl::start_with_next([=](const Group::RejoinEvent &event) {
) | rpl::on_next([=](const Group::RejoinEvent &event) {
const auto guard = gsl::finally([&] {
delegate()->peerListRefreshRows();
});
@@ -411,13 +411,13 @@ void Members::Controller::subscribeToChanges(not_null<Data::GroupCall*> real) {
_fullCount = real->fullCountValue();
real->participantsReloaded(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
prepareRows(real);
}, _lifetime);
using Update = Data::GroupCall::ParticipantUpdate;
real->participantUpdated(
) | rpl::start_with_next([=](const Update &update) {
) | rpl::on_next([=](const Update &update) {
Expects(update.was.has_value() || update.now.has_value());
const auto participantPeer = update.was
@@ -444,7 +444,7 @@ void Members::Controller::subscribeToChanges(not_null<Data::GroupCall*> real) {
toggleVideoEndpointActive(endpoint, true);
}
_call->videoStreamActiveUpdates(
) | rpl::start_with_next([=](const VideoStateToggle &update) {
) | rpl::on_next([=](const VideoStateToggle &update) {
toggleVideoEndpointActive(update.endpoint, update.value);
}, _lifetime);
}
@@ -516,7 +516,7 @@ void Members::Controller::setupInvitedUsers() {
_peer->owner().invitesToCalls(
) | rpl::filter([=](const Invite &invite) {
return (invite.id == _call->id());
}) | rpl::start_with_next([=](const Invite &invite) {
}) | rpl::on_next([=](const Invite &invite) {
const auto user = invite.user;
if (invite.removed) {
if (const auto row = findRow(user)) {
@@ -550,7 +550,7 @@ void Members::Controller::setupWithAccessUsers() {
return;
}
conference->participantsWithAccessValue(
) | rpl::start_with_next([=](base::flat_set<UserId> &&nowIds) {
) | rpl::on_next([=](base::flat_set<UserId> &&nowIds) {
for (auto i = begin(_withAccess); i != end(_withAccess);) {
const auto oldId = *i;
if (nowIds.remove(oldId)) {
@@ -1610,7 +1610,7 @@ void Members::Controller::addMuteActionsToContextMenu(
mutesFromVolume = volumeItem->toggleMuteRequests();
volumeItem->toggleMuteRequests(
) | rpl::start_with_next([=](bool muted) {
) | rpl::on_next([=](bool muted) {
if (muted) {
// Slider value is changed after the callback is called.
// To capture good state inside the slider frame we postpone.
@@ -1622,19 +1622,19 @@ void Members::Controller::addMuteActionsToContextMenu(
}, volumeItem->lifetime());
volumeItem->toggleMuteLocallyRequests(
) | rpl::start_with_next([=](bool muted) {
) | rpl::on_next([=](bool muted) {
if (!isMe(participantPeer)) {
toggleMute(muted, true);
}
}, volumeItem->lifetime());
volumeItem->changeVolumeRequests(
) | rpl::start_with_next([=](int volume) {
) | rpl::on_next([=](int volume) {
changeVolume(volume, false);
}, volumeItem->lifetime());
volumeItem->changeVolumeLocallyRequests(
) | rpl::start_with_next([=](int volume) {
) | rpl::on_next([=](int volume) {
if (!isMe(participantPeer)) {
changeVolume(volume, true);
}
@@ -1680,7 +1680,7 @@ void Members::Controller::addMuteActionsToContextMenu(
if (muteAction) {
std::move(
mutesFromVolume
) | rpl::start_with_next([=](bool mutedFromVolume) {
) | rpl::on_next([=](bool mutedFromVolume) {
const auto state = _call->canManage()
? (mutedFromVolume
? (row->raisedHandRating()
@@ -1869,7 +1869,7 @@ void Members::setupAddMember(not_null<GroupCall*> call) {
_canAddMembers.value(),
_canInviteByLink.value(),
_mode.value()
) | rpl::start_with_next([=](bool add, bool invite, PanelMode mode) {
) | rpl::on_next([=](bool add, bool invite, PanelMode mode) {
if (!add && !invite) {
if (const auto old = _addMemberButton.current()) {
delete old;
@@ -1962,7 +1962,7 @@ void Members::setupList() {
_layout.get(),
st::groupCallMembersTopSkip));
result->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
QPainter(result).fillRect(clip, st::groupCallMembersBg);
}, result->lifetime());
return result;
@@ -1979,7 +1979,7 @@ void Members::setupList() {
_list->heightValue() | rpl::map(_1 > 0),
_addMemberButton.value() | rpl::map(_1 != nullptr)
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool hasList, bool hasAddMembers) {
) | rpl::on_next([=](bool hasList, bool hasAddMembers) {
_topSkip->resize(
_topSkip->width(),
hasList ? st::groupCallMembersTopSkip : 0);
@@ -1990,7 +1990,7 @@ void Members::setupList() {
const auto skip = _layout->add(object_ptr<Ui::RpWidget>(_layout.get()));
_mode.value(
) | rpl::start_with_next([=](PanelMode mode) {
) | rpl::on_next([=](PanelMode mode) {
skip->resize(skip->width(), (mode == PanelMode::Default)
? st::groupCallMembersBottomSkip
: 0);
@@ -1999,14 +1999,14 @@ void Members::setupList() {
rpl::combine(
_mode.value(),
_layout->heightValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
resizeToList();
}, _layout->lifetime());
rpl::combine(
_scroll->scrollTopValue(),
_scroll->heightValue()
) | rpl::start_with_next([=](int scrollTop, int scrollHeight) {
) | rpl::on_next([=](int scrollTop, int scrollHeight) {
_layout->setVisibleTopBottom(scrollTop, scrollTop + scrollHeight);
}, _scroll->lifetime());
}
@@ -2030,7 +2030,7 @@ void Members::setupFingerprint() {
void Members::trackViewportGeometry() {
_call->videoEndpointLargeValue(
) | rpl::start_with_next([=](const VideoEndpoint &large) {
) | rpl::on_next([=](const VideoEndpoint &large) {
_viewport->showLarge(large);
}, _viewport->lifetime());
@@ -2053,19 +2053,19 @@ void Members::trackViewportGeometry() {
std::min(_scroll->height(), _viewport->fullHeight()));
};
_layout->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
_viewport->resizeToWidth(width);
resize();
}, _viewport->lifetime());
_scroll->heightValue(
) | rpl::skip(1) | rpl::start_with_next(resize, _viewport->lifetime());
) | rpl::skip(1) | rpl::on_next(resize, _viewport->lifetime());
_scroll->scrollTopValue(
) | rpl::skip(1) | rpl::start_with_next(move, _viewport->lifetime());
) | rpl::skip(1) | rpl::on_next(move, _viewport->lifetime());
_viewport->fullHeightValue(
) | rpl::start_with_next([=](int viewport) {
) | rpl::on_next([=](int viewport) {
_videoWrap->resize(_videoWrap->width(), viewport);
if (viewport > 0) {
move();
@@ -2124,7 +2124,7 @@ void Members::setupFakeRoundCorners() {
result->resize(size, size);
result->setAttribute(Qt::WA_TransparentForMouseEvents);
result->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
QPainter(result).drawImage(
result->rect(),
*image,
@@ -2154,7 +2154,7 @@ void Members::setupFakeRoundCorners() {
_shareLinkButton.value() | rpl::map(
heightValue
) | rpl::flatten_latest()
) | rpl::start_with_next([=](QRect list, int addMembers, int shareLink) {
) | rpl::on_next([=](QRect list, int addMembers, int shareLink) {
const auto left = list.x();
const auto top = list.y() - _topSkip->height();
const auto right = left + list.width() - topright->width();
@@ -2173,7 +2173,7 @@ void Members::setupFakeRoundCorners() {
refreshImage();
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshImage();
topleft->update();
topright->update();

View File

@@ -106,7 +106,7 @@ MembersRow::BlobsAnimation::BlobsAnimation(
float maxLevel)
: blobs(std::move(blobDatas), levelDuration, maxLevel) {
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
userpicCache = QImage();
}, lifetime);
}
@@ -215,7 +215,7 @@ void MembersRow::setSpeaking(bool speaking) {
_statusIcon->arcs.setStrokeRatio(kArcsStrokeRatio);
_statusIcon->arcsWidth = _statusIcon->arcs.finishedWidth();
_statusIcon->arcs.startUpdateRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (!_statusIcon->arcsAnimation.animating()) {
_statusIcon->wasArcsWidth = _statusIcon->arcsWidth;
}

View File

@@ -132,7 +132,7 @@ JoinAsAction::JoinAsAction(
setClickedCallback(std::move(callback));
paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
Painter p(this);
paint(p);
}, lifetime());
@@ -182,7 +182,7 @@ void JoinAsAction::prepare() {
rpl::combine(
tr::lng_group_call_display_as_header(),
Info::Profile::NameValue(_peer)
) | rpl::start_with_next([=](QString text, QString name) {
) | rpl::on_next([=](QString text, QString name) {
const auto &padding = st::groupCallJoinAsPadding;
_text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions);
_name.setMarkedText(_st.itemStyle, { name }, MenuTextOptions);
@@ -253,7 +253,7 @@ RecordingAction::RecordingAction(
+ st::groupCallRecordingTimerPadding.bottom()) {
std::move(
startAtValues
) | rpl::start_with_next([=](TimeId startAt) {
) | rpl::on_next([=](TimeId startAt) {
_startAt = startAt;
_startedAt = crl::now();
_refreshTimer.cancel();
@@ -266,7 +266,7 @@ RecordingAction::RecordingAction(
setClickedCallback(std::move(callback));
paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
Painter p(this);
paint(p);
}, lifetime());
@@ -344,7 +344,7 @@ void RecordingAction::prepare(rpl::producer<QString> text) {
_st.widthMax);
setMinWidth(w);
std::move(text) | rpl::start_with_next([=](QString text) {
std::move(text) | rpl::on_next([=](QString text) {
const auto &padding = _st.itemPadding;
_text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions);
_textWidth = w - padding.left() - padding.right();

View File

@@ -167,7 +167,7 @@ void ReactionPanel::create() {
_parent = std::make_unique<Ui::RpWidget>(_outer);
_parent->show();
_parent->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
_parent->events() | rpl::on_next([=](not_null<QEvent*> e) {
if (e->type() == QEvent::MouseButtonPress) {
const auto event = static_cast<QMouseEvent*>(e.get());
if (event->button() == Qt::LeftButton) {
@@ -191,7 +191,7 @@ void ReactionPanel::create() {
true);
_selector->chosen(
) | rpl::start_with_next([=](Chosen reaction) {
) | rpl::on_next([=](Chosen reaction) {
if (reaction.id.custom() && !_show->session().premium()) {
ShowPremiumPreviewBox(
_show,
@@ -215,7 +215,7 @@ void ReactionPanel::create() {
_fieldGeometry.value(),
_shownValue.value(),
_expanded.value()
) | rpl::start_with_next([=](QRect field, float64 shown, bool expanded) {
) | rpl::on_next([=](QRect field, float64 shown, bool expanded) {
const auto width = margins.left()
+ _selector->countAppearedWidth(shown)
+ margins.right();
@@ -241,7 +241,7 @@ void ReactionPanel::create() {
}, _selector->lifetime());
_selector->willExpand(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_expanded = true;
const auto raw = _parent.get();
@@ -260,7 +260,7 @@ void ReactionPanel::create() {
});
}, _selector->lifetime());
_selector->escapes() | rpl::start_with_next([=] {
_selector->escapes() | rpl::on_next([=] {
collapse();
}, _selector->lifetime());
}
@@ -276,7 +276,7 @@ void ReactionPanel::fadeOutSelector() {
raw->widget.setGeometry(geometry);
raw->widget.show();
raw->widget.paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (const auto opacity = raw->animation.value(0.)) {
auto p = QPainter(&raw->widget);
p.setOpacity(opacity);
@@ -349,7 +349,7 @@ void MessageField::createControls(PeerData *peer) {
rpl::combine(
_fieldFocused.value(),
_fieldEmpty.value()
) | rpl::start_with_next([=](bool focused, bool empty) {
) | rpl::on_next([=](bool focused, bool empty) {
if (!focused) {
_reactionPanel->hideIfCollapsed();
} else if (empty) {
@@ -360,7 +360,7 @@ void MessageField::createControls(PeerData *peer) {
}, _field->lifetime());
_reactionPanel->chosen(
) | rpl::start_with_next([=](Chosen reaction) {
) | rpl::on_next([=](Chosen reaction) {
if (const auto customId = reaction.id.custom()) {
const auto document = _show->session().data().document(customId);
if (const auto sticker = document->sticker()) {
@@ -439,11 +439,11 @@ void MessageField::createControls(PeerData *peer) {
panel->hide();
panel->selector()->setCurrentPeer(peer);
panel->selector()->emojiChosen(
) | rpl::start_with_next([=](ChatHelpers::EmojiChosen data) {
) | rpl::on_next([=](ChatHelpers::EmojiChosen data) {
Ui::InsertEmojiAtCursor(_field->textCursor(), data.emoji);
}, lifetime());
panel->selector()->customEmojiChosen(
) | rpl::start_with_next([=](ChatHelpers::FileChosen data) {
) | rpl::on_next([=](ChatHelpers::FileChosen data) {
const auto info = data.document->sticker();
if (info
&& info->setType == Data::StickersType::Emoji
@@ -467,7 +467,7 @@ void MessageField::createControls(PeerData *peer) {
_width.value(
) | rpl::filter(
rpl::mappers::_1 > 0
) | rpl::start_with_next([=](int newWidth) {
) | rpl::on_next([=](int newWidth) {
const auto fieldWidth = newWidth
- st::historySendPadding
- _emojiToggle->width()
@@ -483,7 +483,7 @@ void MessageField::createControls(PeerData *peer) {
rpl::combine(
_width.value(),
_field->heightValue()
) | rpl::start_with_next([=](int width, int height) {
) | rpl::on_next([=](int width, int height) {
if (width <= 0) {
return;
}
@@ -494,7 +494,7 @@ void MessageField::createControls(PeerData *peer) {
updateWrapSize();
}, _lifetime);
_field->cancelled() | rpl::start_with_next([=] {
_field->cancelled() | rpl::on_next([=] {
_closeRequests.fire({});
}, _lifetime);
@@ -510,7 +510,7 @@ void MessageField::createControls(PeerData *peer) {
rpl::merge(
_field->submits() | rpl::to_empty,
_send->clicks() | rpl::to_empty
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto text = _field->getTextWithTags();
if (text.text.size() <= _limit) {
_submitted.fire(std::move(text));
@@ -527,7 +527,7 @@ void MessageField::updateEmojiPanelGeometry() {
}
void MessageField::setupBackground() {
_wrap->paintRequest() | rpl::start_with_next([=] {
_wrap->paintRequest() | rpl::on_next([=] {
const auto radius = st::historySendSize.height() / 2.;
auto p = QPainter(_wrap.get());
auto hq = PainterHighQualityEnabler(p);
@@ -568,7 +568,7 @@ void MessageField::toggle(bool shown) {
auto image = Ui::GrabWidgetToImage(_wrap.get());
_cache = std::make_unique<Ui::RpWidget>(_parent);
const auto raw = _cache.get();
raw->paintRequest() | rpl::start_with_next([=] {
raw->paintRequest() | rpl::on_next([=] {
auto p = QPainter(raw);
auto hq = PainterHighQualityEnabler(p);
const auto scale = raw->height() / float64(_wrap->height());

View File

@@ -80,7 +80,7 @@ Messages::Messages(not_null<GroupCall*> call, not_null<MTP::Sender*> api)
, _starsStatsTimer([=] { requestStarsStats(); }) {
Ui::PostponeCall(_call, [=] {
_call->real(
) | rpl::start_with_next([=](not_null<Data::GroupCall*> call) {
) | rpl::on_next([=](not_null<Data::GroupCall*> call) {
_real = call;
if (ready()) {
sendPending();

View File

@@ -392,7 +392,7 @@ void MessagesUi::setupBadges() {
_adminBadge.setText(st::messageTextStyle, tr::lng_admin_badge(tr::now));
_topDonors.value(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
for (auto &entry : _views) {
const auto place = donorPlace(entry.from);
if (entry.place != place) {
@@ -419,7 +419,7 @@ void MessagesUi::setupList(
rpl::combine(
std::move(messages),
std::move(shown)
) | rpl::start_with_next([=](std::vector<Message> &&list, bool shown) {
) | rpl::on_next([=](std::vector<Message> &&list, bool shown) {
if (shown) {
_hidden = std::nullopt;
} else {
@@ -500,7 +500,7 @@ void MessagesUi::showList(const std::vector<Message> &list) {
void MessagesUi::handleIdUpdates(rpl::producer<MessageIdUpdate> idUpdates) {
std::move(
idUpdates
) | rpl::start_with_next([=](MessageIdUpdate update) {
) | rpl::on_next([=](MessageIdUpdate update) {
const auto i = ranges::find(
_views,
update.localId,
@@ -1008,7 +1008,7 @@ void MessagesUi::startReactionAnimation(MessageView &entry) {
rpl::combine(
_scroll->scrollTopValue(),
_scroll->RpWidget::positionValue()
) | rpl::start_with_next([=](int yshift, QPoint point) {
) | rpl::on_next([=](int yshift, QPoint point) {
_reactionBasePosition = point - QPoint(0, yshift);
for (auto &view : _views) {
updateReactionPosition(view);
@@ -1029,7 +1029,7 @@ void MessagesUi::startReactionAnimation(MessageView &entry) {
const auto effectSize = st::reactionInlineImage * 2;
const auto animation = entry.reactionAnimation.get();
raw->resize(effectSize, effectSize);
raw->paintRequest() | rpl::start_with_next([=] {
raw->paintRequest() | rpl::on_next([=] {
if (animation->finished()) {
crl::on_main(raw, [=] {
removeReaction(raw);
@@ -1166,7 +1166,7 @@ void MessagesUi::setupMessagesWidget() {
scroll->scrollTopValue(),
scroll->heightValue(),
_messages->heightValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateTopFade();
updateBottomFade();
}, scroll->lifetime());
@@ -1177,7 +1177,7 @@ void MessagesUi::setupMessagesWidget() {
receiveAllMouseEvents();
}
_messages->paintRequest() | rpl::start_with_next([=](QRect clip) {
_messages->paintRequest() | rpl::on_next([=](QRect clip) {
const auto start = scroll->scrollTop();
const auto end = start + scroll->height();
const auto ratio = style::DevicePixelRatio();
@@ -1429,7 +1429,7 @@ void MessagesUi::receiveSomeMouseEvents() {
}
void MessagesUi::receiveAllMouseEvents() {
_messages->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
_messages->events() | rpl::on_next([=](not_null<QEvent*> e) {
const auto type = e->type();
if (type != QEvent::MouseButtonPress) {
return;
@@ -1529,7 +1529,7 @@ void MessagesUi::setupPinnedWidget() {
scroll->scrollLeftValue(),
scroll->widthValue(),
_pinned->widthValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateLeftFade();
updateRightFade();
}, scroll->lifetime());
@@ -1570,7 +1570,7 @@ void MessagesUi::setupPinnedWidget() {
});
animation->seconds.callEach(crl::time(1000));
_pinned->paintRequest() | rpl::start_with_next([=](QRect clip) {
_pinned->paintRequest() | rpl::on_next([=](QRect clip) {
const auto session = &_show->session();
const auto &colorings = session->appConfig().groupCallColorings();
const auto start = scroll->scrollLeft();
@@ -1713,7 +1713,7 @@ void MessagesUi::setupPinnedWidget() {
}
return MsgId();
};
_pinned->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
_pinned->events() | rpl::on_next([=](not_null<QEvent*> e) {
const auto type = e->type();
if (type == QEvent::MouseButtonPress) {
const auto pos = static_cast<QMouseEvent*>(e.get())->pos();

View File

@@ -279,7 +279,7 @@ Panel::~Panel() {
void Panel::setupRealCallViewers() {
_call->real(
) | rpl::start_with_next([=](not_null<Data::GroupCall*> real) {
) | rpl::on_next([=](not_null<Data::GroupCall*> real) {
subscribeToChanges(real);
}, lifetime());
}
@@ -338,7 +338,7 @@ void Panel::migrate(not_null<ChannelData*> channel) {
void Panel::subscribeToPeerChanges() {
Info::Profile::NameValue(
_peer
) | rpl::start_with_next([=](const QString &name) {
) | rpl::on_next([=](const QString &name) {
window()->setTitle(name);
}, _peerLifetime);
}
@@ -383,7 +383,7 @@ void Panel::initWindow() {
window()->setTitleStyle(st::groupCallTitle);
if (_call->conference()) {
titleText() | rpl::start_with_next([=](const QString &text) {
titleText() | rpl::on_next([=](const QString &text) {
window()->setTitle(text);
}, lifetime());
} else {
@@ -448,11 +448,11 @@ void Panel::initWindow() {
});
_call->hasVideoWithFramesValue(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateMode();
}, lifetime());
_window->maximizeRequests() | rpl::start_with_next([=](bool maximized) {
_window->maximizeRequests() | rpl::on_next([=](bool maximized) {
if (_call->rtmp()) {
toggleFullScreen(maximized);
} else {
@@ -462,7 +462,7 @@ void Panel::initWindow() {
}
}, lifetime());
_window->showingLayer() | rpl::start_with_next([=] {
_window->showingLayer() | rpl::on_next([=] {
hideStickedTooltip(StickedTooltipHide::Unavailable);
}, lifetime());
@@ -476,12 +476,12 @@ void Panel::initWidget() {
widget()->setMouseTracking(true);
widget()->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
paint(clip);
}, lifetime());
widget()->sizeValue(
) | rpl::skip(1) | rpl::start_with_next([=](QSize size) {
) | rpl::skip(1) | rpl::on_next([=](QSize size) {
if (!updateMode()) {
updateControlsGeometry();
}
@@ -506,7 +506,7 @@ void Panel::toggleMessageTyping() {
_messageField->toggle(true);
_messageField->submitted(
) | rpl::start_with_next([=](TextWithTags text) {
) | rpl::on_next([=](TextWithTags text) {
_call->sendMessage(std::move(text));
_messageField->toggle(false);
@@ -514,17 +514,17 @@ void Panel::toggleMessageTyping() {
updateWideControlsVisibility();
}, _messageField->lifetime());
_messageField->heightValue() | rpl::start_with_next([=] {
_messageField->heightValue() | rpl::on_next([=] {
updateButtonsGeometry();
}, _messageField->lifetime());
_messageField->closeRequests() | rpl::start_with_next([=] {
_messageField->closeRequests() | rpl::on_next([=] {
if (_messageTyping.current()) {
toggleMessageTyping();
}
}, _messageField->lifetime());
_messageField->closed() | rpl::start_with_next([=] {
_messageField->closed() | rpl::on_next([=] {
_messageField = nullptr;
updateButtonsGeometry();
}, _messageField->lifetime());
@@ -576,7 +576,7 @@ void Panel::initControls() {
_mute->clicks(
) | rpl::filter([=](Qt::MouseButton button) {
return (button == Qt::LeftButton);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
if (_call->scheduleDate()) {
if (_call->canManage()) {
startScheduledNow();
@@ -611,7 +611,7 @@ void Panel::initControls() {
rpl::combine(
_mode.value(),
_call->canManageValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshTopButton();
}, lifetime());
@@ -638,12 +638,12 @@ void Panel::initControls() {
_peer,
Data::PeerUpdate::Flag::Username
) | rpl::skip(1) | rpl::to_empty
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshLeftButton();
updateControlsGeometry();
}, _callLifetime);
std::move(started) | rpl::start_with_next([=] {
std::move(started) | rpl::on_next([=] {
refreshVideoButtons();
updateButtonsStyles();
setupMembers();
@@ -658,19 +658,19 @@ void Panel::initControls() {
|| (state == State::Ended)
|| (state == State::FailedHangingUp)
|| (state == State::Failed);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
closeBeforeDestroy();
}, _callLifetime);
_call->levelUpdates(
) | rpl::filter([=](const LevelUpdate &update) {
return update.me;
}) | rpl::start_with_next([=](const LevelUpdate &update) {
}) | rpl::on_next([=](const LevelUpdate &update) {
_mute->setLevel(update.value);
}, _callLifetime);
_call->real(
) | rpl::start_with_next([=](not_null<Data::GroupCall*> real) {
) | rpl::on_next([=](not_null<Data::GroupCall*> real) {
setupRealMuteButtonState(real);
}, _callLifetime);
@@ -757,7 +757,7 @@ void Panel::refreshVideoButtons(std::optional<bool> overrideWideMode) {
_video->setColorOverrides(
toggleableOverrides(_call->isSharingCameraValue()));
_call->isSharingCameraValue(
) | rpl::start_with_next([=](bool sharing) {
) | rpl::on_next([=](bool sharing) {
if (sharing) {
hideStickedTooltip(
StickedTooltip::Camera,
@@ -775,7 +775,7 @@ void Panel::refreshVideoButtons(std::optional<bool> overrideWideMode) {
_screenShare->setColorOverrides(
toggleableOverrides(_call->isSharingScreenValue()));
_call->isSharingScreenValue(
) | rpl::start_with_next([=](bool sharing) {
) | rpl::on_next([=](bool sharing) {
_screenShare->setProgress(sharing ? 1. : 0.);
}, _screenShare->lifetime());
}
@@ -869,7 +869,7 @@ void Panel::setupRealMuteButtonState(not_null<Data::GroupCall*> real) {
) | rpl::distinct_until_changed(
) | rpl::filter(
_2 != GroupCall::InstanceState::TransitionToRtc
) | rpl::start_with_next([=](
) | rpl::on_next([=](
MuteState mute,
GroupCall::InstanceState state,
TimeId scheduleDate,
@@ -969,7 +969,7 @@ void Panel::setupScheduledLabels(rpl::producer<TimeId> date) {
rpl::combine(
widget()->sizeValue(),
_startsIn->widthValue()
) | rpl::start_with_next([=](QSize size, int width) {
) | rpl::on_next([=](QSize size, int width) {
_startsIn->move(
(size.width() - width) / 2,
top() + st::groupCallStartsInTop);
@@ -978,7 +978,7 @@ void Panel::setupScheduledLabels(rpl::producer<TimeId> date) {
rpl::combine(
widget()->sizeValue(),
_startsWhen->widthValue()
) | rpl::start_with_next([=](QSize size, int width) {
) | rpl::on_next([=](QSize size, int width) {
_startsWhen->move(
(size.width() - width) / 2,
top() + st::groupCallStartsWhenTop);
@@ -987,7 +987,7 @@ void Panel::setupScheduledLabels(rpl::producer<TimeId> date) {
rpl::combine(
widget()->sizeValue(),
_countdown->widthValue()
) | rpl::start_with_next([=](QSize size, int width) {
) | rpl::on_next([=](QSize size, int width) {
_countdown->move(
(size.width() - width) / 2,
top() + st::groupCallCountdownTop);
@@ -1014,7 +1014,7 @@ void Panel::setupMembers() {
_viewport->mouseInsideValue(
) | rpl::filter([=] {
return !_rtmpFull;
}) | rpl::start_with_next([=](bool inside) {
}) | rpl::on_next([=](bool inside) {
toggleWideControls(inside);
}, _viewport->lifetime());
@@ -1025,27 +1025,27 @@ void Panel::setupMembers() {
raiseControls();
_members->desiredHeightValue(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateMembersGeometry();
}, _members->lifetime());
_members->toggleMuteRequests(
) | rpl::start_with_next([=](MuteRequest request) {
) | rpl::on_next([=](MuteRequest request) {
_call->toggleMute(request);
}, _callLifetime);
_members->changeVolumeRequests(
) | rpl::start_with_next([=](VolumeRequest request) {
) | rpl::on_next([=](VolumeRequest request) {
_call->changeVolume(request);
}, _callLifetime);
_members->kickParticipantRequests(
) | rpl::start_with_next([=](not_null<PeerData*> participantPeer) {
) | rpl::on_next([=](not_null<PeerData*> participantPeer) {
kickParticipant(participantPeer);
}, _callLifetime);
_members->addMembersRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (_call->conference()) {
addMembers();
} else if (!_peer->isBroadcast()
@@ -1060,10 +1060,10 @@ void Panel::setupMembers() {
}, _callLifetime);
_members->shareLinkRequests(
) | rpl::start_with_next(shareConferenceLinkCallback(), _callLifetime);
) | rpl::on_next(shareConferenceLinkCallback(), _callLifetime);
_call->videoEndpointLargeValue(
) | rpl::start_with_next([=](const VideoEndpoint &large) {
) | rpl::on_next([=](const VideoEndpoint &large) {
if (large && mode() != PanelMode::Wide) {
enlargeVideo();
}
@@ -1214,7 +1214,7 @@ void Panel::setupVideo(not_null<Viewport*> viewport) {
setupTile(endpoint, track);
}
_call->videoStreamActiveUpdates(
) | rpl::start_with_next([=](const VideoStateToggle &update) {
) | rpl::on_next([=](const VideoStateToggle &update) {
if (update.value) {
// Add async (=> the participant row is definitely in Members).
const auto endpoint = update.endpoint;
@@ -1232,14 +1232,14 @@ void Panel::setupVideo(not_null<Viewport*> viewport) {
}, viewport->lifetime());
viewport->pinToggled(
) | rpl::start_with_next([=](bool pinned) {
) | rpl::on_next([=](bool pinned) {
_call->pinVideoEndpoint(pinned
? _call->videoEndpointLarge()
: VideoEndpoint{});
}, viewport->lifetime());
viewport->clicks(
) | rpl::start_with_next([=](VideoEndpoint &&endpoint) {
) | rpl::on_next([=](VideoEndpoint &&endpoint) {
if (_call->videoEndpointLarge() == endpoint) {
_call->showVideoEndpointLarge({});
} else if (_call->videoEndpointPinned()) {
@@ -1250,7 +1250,7 @@ void Panel::setupVideo(not_null<Viewport*> viewport) {
}, viewport->lifetime());
viewport->qualityRequests(
) | rpl::start_with_next([=](const VideoQualityRequest &request) {
) | rpl::on_next([=](const VideoQualityRequest &request) {
_call->requestVideoQuality(request.endpoint, request.quality);
}, viewport->lifetime());
}
@@ -1319,7 +1319,7 @@ void Panel::subscribeToChanges(not_null<Data::GroupCall*> real) {
animate();
_recordingMark->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_recordingMark.data());
auto hq = PainterHighQualityEnabler(p);
p.setPen(Qt::NoPen);
@@ -1338,7 +1338,7 @@ void Panel::subscribeToChanges(not_null<Data::GroupCall*> real) {
) | rpl::map(
_1 != 0
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](bool recorded) {
) | rpl::on_next([=](bool recorded) {
const auto livestream = _call->peer()->isBroadcast();
const auto isVideo = real->recordVideo();
if (recorded) {
@@ -1367,12 +1367,12 @@ void Panel::subscribeToChanges(not_null<Data::GroupCall*> real) {
rpl::combine(
_call->videoIsWorkingValue(),
_call->isSharingCameraValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshVideoButtons();
showStickedTooltip();
}, lifetime());
_call->messagesEnabledValue() | rpl::start_with_next([=] {
_call->messagesEnabledValue() | rpl::on_next([=] {
updateButtonsGeometry();
raiseControls();
}, lifetime());
@@ -1380,12 +1380,12 @@ void Panel::subscribeToChanges(not_null<Data::GroupCall*> real) {
rpl::combine(
_call->videoIsWorkingValue(),
_call->isSharingScreenValue()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshTopButton();
}, lifetime());
_call->mutedValue(
) | rpl::skip(1) | rpl::start_with_next([=](MuteState state) {
) | rpl::skip(1) | rpl::on_next([=](MuteState state) {
updateButtonsGeometry();
if (state == MuteState::Active
|| state == MuteState::PushToTalk) {
@@ -1419,7 +1419,7 @@ void Panel::createPinOnTop() {
}
};
_fullScreenOrMaximized.value(
) | rpl::start_with_next([=](bool fullScreenOrMaximized) {
) | rpl::on_next([=](bool fullScreenOrMaximized) {
_window->setControlsStyle(fullScreenOrMaximized
? st::callTitle
: st::groupCallTitle);
@@ -1436,7 +1436,7 @@ void Panel::createPinOnTop() {
_viewport->rp()->events(
) | rpl::filter([](not_null<QEvent*> event) {
return (event->type() == QEvent::MouseMove);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
_hideControlsTimer.callOnce(kHideControlsTimeout);
toggleWideControls(true);
}, _hideControlsTimerLifetime);
@@ -1491,7 +1491,7 @@ void Panel::refreshTopButton() {
) | rpl::then(_call->rejoinEvents(
) | rpl::map([](const RejoinEvent &event) {
return event.nowJoinAs;
})) | rpl::start_with_next([=](not_null<PeerData*> joinAs) {
})) | rpl::on_next([=](not_null<PeerData*> joinAs) {
auto joinAsToggle = object_ptr<Ui::UserpicButton>(
widget(),
joinAs,
@@ -1739,7 +1739,7 @@ void Panel::initLayout(ConferencePanelMigration info) {
_window->raiseControls();
_window->controlsLayoutChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
// _menuToggle geometry depends on _controls arrangement.
crl::on_main(this, [=] { updateControlsGeometry(); });
}, lifetime());
@@ -1893,7 +1893,7 @@ void Panel::updateButtonsStyles() {
void Panel::setupEmptyRtmp() {
_call->emptyRtmpValue(
) | rpl::start_with_next([=](bool empty) {
) | rpl::on_next([=](bool empty) {
if (!empty) {
_emptyRtmp.destroy();
return;
@@ -1924,13 +1924,13 @@ void Panel::setupEmptyRtmp() {
_emptyRtmp->setAttribute(Qt::WA_TransparentForMouseEvents);
_emptyRtmp->show();
_emptyRtmp->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_emptyRtmp.data());
label->corners.paint(p, _emptyRtmp->rect());
}, _emptyRtmp->lifetime());
widget()->sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
const auto padding = st::groupCallWidth / 30;
const auto width = std::min(
size.width() - padding * 4,
@@ -1987,7 +1987,7 @@ void Panel::refreshTitleBackground() {
st::roundRadiusLarge,
_controlsBackgroundColor.color());
_titleBackground->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_titleBackground.data());
corners->paintSomeRounded(
p,
@@ -2014,7 +2014,7 @@ void Panel::setupControlsBackgroundNarrow() {
QImage::Format_ARGB32_Premultiplied);
rpl::single(rpl::empty) | rpl::then(
style::PaletteChanged()
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
full->fill(Qt::transparent);
auto p = QPainter(full);
@@ -2055,7 +2055,7 @@ void Panel::setupControlsBackgroundNarrow() {
- st::groupCallMembersMargin.right()),
height);
_controlsBackgroundNarrow->shadow.paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
auto p = QPainter(&_controlsBackgroundNarrow->shadow);
clip = clip.intersected(_controlsBackgroundNarrow->shadow.rect());
const auto inner = _members->getInnerGeometry().translated(
@@ -2097,7 +2097,7 @@ void Panel::setupControlsBackgroundWide() {
st::groupCallControlsBackRadius,
_controlsBackgroundColor.color());
_controlsBackgroundWide->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(_controlsBackgroundWide.data());
corners->paint(p, _controlsBackgroundWide->rect());
}, lifetime);
@@ -2111,7 +2111,7 @@ void Panel::trackControl(Ui::RpWidget *widget, rpl::lifetime &lifetime) {
}
const auto over = std::make_shared<bool>();
widget->events(
) | rpl::start_with_next([=](not_null<QEvent*> e) {
) | rpl::on_next([=](not_null<QEvent*> e) {
const auto type = e->type();
if (type == QEvent::Enter) {
// Enter events may come from widget destructors,
@@ -2254,7 +2254,7 @@ void Panel::showNiceTooltip(
rpl::combine(
label->sizeValue(),
button->sizeValue()
) | rpl::start_with_next([=](QSize text, QSize close) {
) | rpl::on_next([=](QSize text, QSize close) {
const auto height = std::max(text.height(), close.height());
container->resize(text.width() + close.width(), height);
label->move(0, (height - text.height()) / 2);
@@ -2285,7 +2285,7 @@ void Panel::showNiceTooltip(
base::qt_signal_producer(
control.get(),
&QObject::destroyed
) | rpl::start_with_next(destroy, tooltip->lifetime());
) | rpl::on_next(destroy, tooltip->lifetime());
_niceTooltipControl = control;
updateTooltipGeometry();
@@ -2765,7 +2765,7 @@ void Panel::refreshTitle() {
refreshTitleColors();
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
refreshTitleColors();
}, _title->lifetime());
}

View File

@@ -140,7 +140,7 @@ void StartRtmpProcess::start(
.done = std::move(done),
});
session->account().sessionChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_request = nullptr;
}, _request->lifetime);
@@ -214,7 +214,7 @@ void StartRtmpProcess::createBox() {
_request->show,
_request->data.value());
object->boxClosing(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_request = nullptr;
}, _request->lifetime);
_request->box = base::make_weak(object.data());
@@ -272,7 +272,7 @@ void StartRtmpProcess::FillRtmpRows(
const auto weak = container->add(std::move(wrap), rowPadding);
Ui::AddSkip(container, st::groupCallRtmpCopyButtonBottomSkip);
button->heightValue(
) | rpl::start_with_next([=](int height) {
) | rpl::on_next([=](int height) {
weak->resize(weak->width(), height);
}, container->lifetime());
return weak;

View File

@@ -377,7 +377,7 @@ void SettingsBox(
))->toggleOn(rpl::single(
settings.groupCallNoiseSuppression()
))->toggledChanges(
) | rpl::start_with_next([=](bool enabled) {
) | rpl::on_next([=](bool enabled) {
Core::App().settings().setGroupCallNoiseSuppression(enabled);
call->setNoiseSuppression(enabled);
Core::App().saveSettingsDelayed();
@@ -482,7 +482,7 @@ void SettingsBox(
kCheckAccessibilityInterval
) | rpl::filter([] {
return base::GlobalShortcutsAllowed();
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
box->closeBox();
}, box->lifetime());
}
@@ -579,7 +579,7 @@ void SettingsBox(
settings.groupCallPushToTalk(),
anim::type::instant);
pushToTalk->toggledChanges(
) | rpl::start_with_next([=](bool toggled) {
) | rpl::on_next([=](bool toggled) {
if (!toggled) {
stopRecording();
} else if (!ensureManager()) {
@@ -801,12 +801,12 @@ void SettingsBox(
});
volumeItem->toggleMuteLocallyRequests(
) | rpl::start_with_next([=](bool muted) {
) | rpl::on_next([=](bool muted) {
toggleMute(muted, true);
}, volumeItem->lifetime());
volumeItem->changeVolumeLocallyRequests(
) | rpl::start_with_next([=](int volume) {
) | rpl::on_next([=](int volume) {
changeVolume(volume, true);
}, volumeItem->lifetime());
}
@@ -849,7 +849,7 @@ void SettingsBox(
box->setTitle(tr::lng_group_call_settings_title());
box->boxClosing(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (canChangeJoinMuted
&& muteJoined
&& muteJoined->toggled() != joinMuted) {

View File

@@ -50,7 +50,7 @@ void Toasts::setupJoinAsChanged() {
return _call->stateValue() | rpl::filter([](State state) {
return (state == State::Joined);
}) | rpl::take(1);
}) | rpl::flatten_latest() | rpl::start_with_next([=] {
}) | rpl::flatten_latest() | rpl::on_next([=] {
_panel->uiShow()->showToast((_call->peer()->isBroadcast()
? tr::lng_group_call_join_as_changed_channel
: tr::lng_group_call_join_as_changed)(
@@ -70,7 +70,7 @@ void Toasts::setupTitleChanged() {
return peer->groupCall()->title().isEmpty()
? peer->name()
: peer->groupCall()->title();
}) | rpl::start_with_next([=](const QString &title) {
}) | rpl::on_next([=](const QString &title) {
_panel->uiShow()->showToast((_call->peer()->isBroadcast()
? tr::lng_group_call_title_changed_channel
: tr::lng_group_call_title_changed)(
@@ -83,7 +83,7 @@ void Toasts::setupTitleChanged() {
void Toasts::setupAllowedToSpeak() {
_call->allowedToSpeakNotifications(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (_panel->isActive()) {
_panel->uiShow()->showToast(
tr::lng_group_call_can_speak_here(tr::now));
@@ -112,7 +112,7 @@ void Toasts::setupPinnedVideo() {
}) | rpl::flatten_latest(
) | rpl::filter([=] {
return (_call->shownVideoTracks().size() > 1);
}) | rpl::start_with_next([=](const VideoEndpoint &endpoint) {
}) | rpl::on_next([=](const VideoEndpoint &endpoint) {
const auto pinned = _call->videoEndpointPinned();
const auto peer = endpoint.peer;
if (!peer) {
@@ -147,7 +147,7 @@ void Toasts::setupPinnedVideo() {
void Toasts::setupRequestedToSpeak() {
_call->mutedValue(
) | rpl::combine_previous(
) | rpl::start_with_next([=](MuteState was, MuteState now) {
) | rpl::on_next([=](MuteState was, MuteState now) {
if (was == MuteState::ForceMuted && now == MuteState::RaisedHand) {
_panel->uiShow()->showToast(
tr::lng_group_call_tooltip_raised_hand(tr::now));
@@ -157,7 +157,7 @@ void Toasts::setupRequestedToSpeak() {
void Toasts::setupError() {
_call->errors(
) | rpl::start_with_next([=](Error error) {
) | rpl::on_next([=](Error error) {
const auto key = [&] {
switch (error) {
case Error::NoCamera: return tr::lng_call_error_no_camera;

View File

@@ -102,12 +102,12 @@ void Viewport::setup() {
_content->sizeValue(
) | rpl::filter([=] {
return wide() || videoStream();
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
updateTilesGeometry();
}, lifetime());
_content->events(
) | rpl::start_with_next([=](not_null<QEvent*> e) {
) | rpl::on_next([=](not_null<QEvent*> e) {
const auto type = e->type();
if (type == QEvent::Enter) {
Ui::Integration::Instance().registerLeaveSubscription(raw);
@@ -299,12 +299,12 @@ void Viewport::add(
_tiles.back()->trackSizeValue(
) | rpl::filter([](QSize size) {
return !size.isEmpty();
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
updateTilesGeometry();
}, _tiles.back()->lifetime());
_tiles.back()->track()->stateValue(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateTilesGeometry();
}, _tiles.back()->lifetime());
}

View File

@@ -308,7 +308,7 @@ Viewport::RendererGL::RendererGL(not_null<Viewport*> owner)
st::radialBg) {
style::PaletteChanged(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_buttons.invalidate();
}, _lifetime);
}

View File

@@ -44,7 +44,7 @@ Viewport::VideoTile::VideoTile(
_track.track->stateValue(
) | rpl::filter(
_1 == Webrtc::VideoState::Paused
) | rpl::take(1) | rpl::start_with_next([=] {
) | rpl::take(1) | rpl::on_next([=] {
_wasPaused = true;
}, _lifetime);
@@ -260,7 +260,7 @@ void Viewport::VideoTile::setup(rpl::producer<bool> pinned) {
pinned
) | rpl::filter([=](bool pinned) {
return (_pinned != pinned);
}) | rpl::start_with_next([=](bool pinned) {
}) | rpl::on_next([=](bool pinned) {
_pinned = pinned;
updateTopControlsSize();
if (!_hidden) {
@@ -270,7 +270,7 @@ void Viewport::VideoTile::setup(rpl::producer<bool> pinned) {
}, _lifetime);
_track.track->renderNextFrame(
) | rpl::start_with_next(_update, _lifetime);
) | rpl::on_next(_update, _lifetime);
updateTopControlsSize();
}

View File

@@ -72,7 +72,7 @@ MenuVolumeItem::MenuVolumeItem(
_slider->setAlwaysDisplayMarker(true);
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
const auto geometry = QRect(QPoint(), size);
_itemRect = geometry - _padding;
_speakerRect = QRect(_itemRect.topLeft(), _stCross.icon.size());
@@ -90,7 +90,7 @@ MenuVolumeItem::MenuVolumeItem(
setCloudVolume(startVolume);
paintRequest(
) | rpl::start_with_next([=](const QRect &clip) {
) | rpl::on_next([=](const QRect &clip) {
auto p = QPainter(this);
const auto volume = _localMuted
@@ -167,7 +167,7 @@ MenuVolumeItem::MenuVolumeItem(
std::move(
participantState
) | rpl::start_with_next([=](const Group::ParticipantState &state) {
) | rpl::on_next([=](const Group::ParticipantState &state) {
const auto newMuted = state.mutedByMe;
const auto newVolume = state.volume.value_or(0);
@@ -210,7 +210,7 @@ void MenuVolumeItem::initArcsAnimation() {
});
_arcs->startUpdateRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (!_arcsAnimation.animating()) {
*lastTime = crl::now();
_arcsAnimation.start();
@@ -218,7 +218,7 @@ void MenuVolumeItem::initArcsAnimation() {
}, lifetime());
_arcs->stopUpdateRequests(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
_arcsAnimation.stop();
}, lifetime());
}

View File

@@ -121,7 +121,7 @@ RecordingInfo::RecordingInfo(not_null<Ui::RpWidget*> parent)
: RpWidget(parent)
, _container(this) {
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
_container->resizeToWidth(size.width());
}, _container->lifetime());
}
@@ -140,7 +140,7 @@ void RecordingInfo::prepareAudio() {
audioIcon->setAttribute(Qt::WA_TransparentForMouseEvents);
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
audioIcon->moveToLeft((size.width() - audioIcon->width()) / 2, 0);
}, lifetime());
}
@@ -175,7 +175,7 @@ void RecordingInfo::prepareVideo() {
};
for (const auto icon : icons) {
icon->clicks(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
for (const auto &i : icons) {
i->setToggled(icon == i);
}
@@ -184,7 +184,7 @@ void RecordingInfo::prepareVideo() {
}
wrap->sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
const auto wHalf = size.width() / icons.size();
for (auto i = 0; i < icons.size(); i++) {
const auto &icon = icons[i];
@@ -230,7 +230,7 @@ Switcher::Switcher(
};
sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
) | rpl::on_next([=](const QSize &size) {
_audio->resize(size.width(), size.height());
_video->resize(size.width(), size.height());
@@ -242,7 +242,7 @@ Switcher::Switcher(
std::move(
toggled
) | rpl::start_with_next([=](bool toggled) {
) | rpl::on_next([=](bool toggled) {
_toggled = toggled;
_animation.start(
updatePositions,
@@ -281,7 +281,7 @@ void EditGroupCallTitleBox(
box->closeBox();
done(result);
};
input->submits() | rpl::start_with_next(submit, input->lifetime());
input->submits() | rpl::on_next(submit, input->lifetime());
box->addButton(tr::lng_settings_save(), submit);
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
}
@@ -340,7 +340,7 @@ void AddTitleGroupCallRecordingBox(
box->closeBox();
done(result);
};
input->submits() | rpl::start_with_next(submit, input->lifetime());
input->submits() | rpl::on_next(submit, input->lifetime());
box->addButton(tr::lng_group_call_recording_start_button(), submit);
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
}

View File

@@ -99,7 +99,7 @@ object_ptr<Ui::RpWidget> CreateGradientLabel(
std::move(
text
) | rpl::start_with_next([=](const QString &text) {
) | rpl::on_next([=](const QString &text) {
state->path = QPainterPath();
const auto &font = st::groupCallCountdownFont;
state->path.addText(0, font->ascent, font->f, text);
@@ -116,7 +116,7 @@ object_ptr<Ui::RpWidget> CreateGradientLabel(
}, raw->lifetime());
raw->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = QPainter(raw);
auto hq = PainterHighQualityEnabler(p);
const auto skip = st::groupCallWidth / 20;

View File

@@ -147,14 +147,14 @@ Source::Source(
, _activeRect(ImageRoundRadius::Large, st::groupCallMuted1)
, _source(source) {
_widget.paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
paint();
}, _widget.lifetime());
_label.setAttribute(Qt::WA_TransparentForMouseEvents);
_widget.sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
const auto padding = st::desktopCapturePadding;
_label.resizeToNaturalWidth(
size.width() - padding.left() - padding.right());
@@ -237,7 +237,7 @@ void Source::paint() {
void Source::setupPreview() {
_preview = std::make_unique<Preview>(_source);
_preview->track.renderNextFrame(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
if (_preview->track.frameSize().isEmpty()) {
_preview->track.markFrameShown();
}
@@ -341,7 +341,7 @@ void ChooseSourceProcess::setupPanel() {
_window->setStaysOnTop(true);
_window->body()->paintRequest(
) | rpl::start_with_next([=](QRect clip) {
) | rpl::on_next([=](QRect clip) {
QPainter(_window->body()).fillRect(clip, st::groupCallMembersBg);
}, _window->lifetime());
@@ -380,7 +380,7 @@ void ChooseSourceProcess::setupPanel() {
_finish->widthValue(),
_finish->shownValue(),
cancel->widthValue()
) | rpl::start_with_next([=](
) | rpl::on_next([=](
int submitWidth,
bool submitShown,
int finishWidth,
@@ -394,14 +394,14 @@ void ChooseSourceProcess::setupPanel() {
}, _bottom->lifetime());
_withAudio->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
const auto top = (bottomHeight - _withAudio->heightNoMargins()) / 2;
_withAudio->moveToLeft(bottomSkip, top);
}, _withAudio->lifetime());
_withAudio->setChecked(_delegate->chooseSourceActiveWithAudio());
_withAudio->checkedChanges(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
updateButtonsVisibility();
}, _withAudio->lifetime());
@@ -410,7 +410,7 @@ void ChooseSourceProcess::setupPanel() {
_submit->setVisible(!sharing);
_window->body()->sizeValue(
) | rpl::start_with_next([=](QSize size) {
) | rpl::on_next([=](QSize size) {
_scroll->setGeometry(
0,
0,
@@ -419,7 +419,7 @@ void ChooseSourceProcess::setupPanel() {
}, _scroll->lifetime());
_scroll->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
const auto rows = int(std::ceil(_sources.size() / float(kColumns)));
const auto innerHeight = margins.top()
+ rows * st::desktopCaptureSourceSize.height()
@@ -435,7 +435,7 @@ void ChooseSourceProcess::setupPanel() {
_window->events(
) | rpl::filter([=](not_null<QEvent*> e) {
return e->type() == QEvent::Close;
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
destroy();
}, _window->lifetime());
}
@@ -481,7 +481,7 @@ void ChooseSourceProcess::fillSources() {
_sources.back()->activations(
) | rpl::filter([=] {
return (_selected != raw);
}) | rpl::start_with_next([=]{
}) | rpl::on_next([=]{
if (_selected) {
_selected->setActive(false);
}
@@ -524,7 +524,7 @@ void ChooseSourceProcess::setupSourcesGeometry() {
return;
}
_inner->widthValue(
) | rpl::start_with_next([=](int width) {
) | rpl::on_next([=](int width) {
const auto rows = int(std::ceil(_sources.size() / float(kColumns)));
const auto margins = st::desktopCaptureMargins;
const auto skips = st::desktopCaptureSourceSkips;
@@ -554,7 +554,7 @@ void ChooseSourceProcess::setupSourcesGeometry() {
rpl::combine(
_scroll->scrollTopValue(),
_scroll->heightValue()
) | rpl::start_with_next([=](int scrollTop, int scrollHeight) {
) | rpl::on_next([=](int scrollTop, int scrollHeight) {
const auto rows = int(std::ceil(_sources.size() / float(kColumns)));
const auto margins = st::desktopCaptureMargins;
const auto skips = st::desktopCaptureSourceSkips;

View File

@@ -116,7 +116,7 @@ Selector::Selector(
const auto group = std::make_shared<Ui::RadiobuttonGroup>();
std::move(
chosen
) | rpl::start_with_next([=](Webrtc::DeviceResolvedId id) {
) | rpl::on_next([=](Webrtc::DeviceResolvedId id) {
const auto value = id.isDefault() ? 0 : registerId(id.value);
if (!group->hasValue() || group->current() != value) {
group->setValue(value);
@@ -138,7 +138,7 @@ Selector::Selector(
std::move(
devices
) | rpl::start_with_next([=](const std::vector<Webrtc::DeviceInfo> &v) {
) | rpl::on_next([=](const std::vector<Webrtc::DeviceInfo> &v) {
while (_list->count()) {
delete _list->widgetAt(0);
}