fix: make it build

This commit is contained in:
AlexeyZavar
2025-12-30 16:06:41 +03:00
parent cb24e7d085
commit 672ca18dde
50 changed files with 194 additions and 198 deletions
-6
View File
@@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
+5 -5
View File
@@ -68,7 +68,7 @@ void initialize() {
[=](bool val)
{
return (val != settings->sendReadMessages);
}) | start_with_next(
}) | on_next(
[=](bool val)
{
ghostModeEnabled =
@@ -80,7 +80,7 @@ void initialize() {
[=](bool val)
{
return (val != settings->sendReadStories);
}) | start_with_next(
}) | on_next(
[=](bool val)
{
ghostModeEnabled =
@@ -92,7 +92,7 @@ void initialize() {
[=](bool val)
{
return (val != settings->sendOnlinePackets);
}) | start_with_next(
}) | on_next(
[=](bool val)
{
ghostModeEnabled =
@@ -105,7 +105,7 @@ void initialize() {
[=](bool val)
{
return (val != settings->sendUploadProgress);
}) | start_with_next(
}) | on_next(
[=](bool val)
{
ghostModeEnabled =
@@ -119,7 +119,7 @@ void initialize() {
{
return (val
!= settings->sendOfflinePacketAfterOnline);
}) | start_with_next(
}) | on_next(
[=](bool val)
{
ghostModeEnabled =
@@ -122,7 +122,7 @@ void loadDocumentSync(not_null<Main::Session*> session, DocumentData *data, not_
session->downloaderTaskFinished() | rpl::filter([=]
{
return !data || data->status == FileDownloadFailed || fileSize(item) == data->size;
}) | rpl::start_with_next([=]() mutable
}) | rpl::on_next([=]() mutable
{
latch->countDown();
},
@@ -213,7 +213,7 @@ void loadPhotoSync(not_null<Main::Session*> session, const std::pair<not_null<Ph
session->downloaderTaskFinished() | rpl::filter([=]
{
return finalCheck();
}) | rpl::start_with_next([=]() mutable
}) | rpl::on_next([=]() mutable
{
saveToFiles();
latch->countDown();
@@ -249,7 +249,7 @@ void waitForMsgSync(not_null<Main::Session*> session, const Api::SendAction &act
| rpl::filter([=](const Data::Session::IdChange &update)
{
return action.history->peer->id == update.newId.peer;
}) | rpl::start_with_next([=]
}) | rpl::on_next([=]
{
latch->countDown();
},
@@ -460,7 +460,7 @@ void Wrapper(not_null<HistoryView::ListWidget*> widget, Fn<void()> clearSelected
messages,
};
auto box = Box<MessageShotBox>(config);
box->boxClosing() | rpl::start_with_next([=]
box->boxClosing() | rpl::on_next([=]
{
clearSelected();
}, box->lifetime());
@@ -63,7 +63,7 @@ object_ptr<Ui::RpWidget> CreateTopLogoWidget(
const auto logo = MakeSupportLogo();
raw->paintRequest(
) | rpl::start_with_next(
) | rpl::on_next(
[=](QRect)
{
QPainter p(raw);
@@ -104,7 +104,7 @@ object_ptr<Ui::RpWidget> InfoRow(
raw->add(
object_ptr<Ui::FlatLabel>(
raw,
rpl::single(title) | Ui::Text::ToBold(),
rpl::single(tr::bold(title)),
st::defaultFlatLabel),
st::settingsPremiumRowTitlePadding);
@@ -151,8 +151,7 @@ void FillDonateInfoBox(not_null<Ui::GenericBox*> box, not_null<Window::SessionCo
box->verticalLayout()->add(
object_ptr<Ui::FlatLabel>(
box->verticalLayout(),
tr::ayu_SupportBoxHeader()
| Ui::Text::ToBold(),
tr::ayu_SupportBoxHeader(tr::bold),
st::boxTitle),
st::boxRowPadding,
style::al_top);
@@ -190,7 +189,7 @@ void FillDonateInfoBox(not_null<Ui::GenericBox*> box, not_null<Window::SessionCo
TextWithEntities{dollarAmount},
lt_amount2,
innerText,
Ui::Text::RichLangValue
tr::rich
);
box->verticalLayout()->add(InfoRow(
@@ -212,7 +211,7 @@ void FillDonateInfoBox(not_null<Ui::GenericBox*> box, not_null<Window::SessionCo
tr::now,
lt_item,
Ui::Text::Link(username, controller->session().createInternalLinkFull(usernameTrimmed)),
Ui::Text::RichLangValue);
tr::rich);
box->verticalLayout()->add(InfoRow(
box->verticalLayout(),
&controller->session(),
@@ -243,7 +242,7 @@ void FillDonateInfoBox(not_null<Ui::GenericBox*> box, not_null<Window::SessionCo
closeButton->widthValue() | rpl::filter([=]
{
return (closeButton->widthNoMargins() != buttonWidth);
}) | rpl::start_with_next([=]
}) | rpl::on_next([=]
{
closeButton->resizeToWidth(buttonWidth);
},
@@ -114,7 +114,7 @@ void FillDonateQrBox(
recompute();
qrWidget->paintRequest(
) | rpl::start_with_next([=](QRect) {
) | rpl::on_next([=](QRect) {
QPainter p(qrWidget);
PainterHighQualityEnabler hq(p);
@@ -154,7 +154,7 @@ void FillDonateQrBox(
- rect::m::sum::h(st::giveawayGiftCodeBox.buttonPadding);
copyButton->widthValue() | rpl::filter([=] {
return (copyButton->widthNoMargins() != buttonWidth);
}) | rpl::start_with_next([=] {
}) | rpl::on_next([=] {
copyButton->resizeToWidth(buttonWidth);
}, copyButton->lifetime());
@@ -64,7 +64,7 @@ void EditMarkBox::prepare() {
submit();
};
_text->submits(
) | rpl::start_with_next(submitted, _text->lifetime());
) | rpl::on_next(submitted, _text->lifetime());
}
void EditMarkBox::setInnerFocus() {
@@ -688,7 +688,7 @@ void Content::setupContent(
inner,
st::defaultBox.margin.top()));
rows->isEmpty() | rpl::start_with_next([=](bool empty)
rows->isEmpty() | rpl::on_next([=](bool empty)
{
wrap->toggle(!empty, anim::type::instant);
},
@@ -712,7 +712,7 @@ void Content::setupContent(
rpl::single(qs("No fonts found.")),
st::membersAbout);
empty->entity()->sizeValue(
) | rpl::start_with_next([=](QSize size)
) | rpl::on_next([=](QSize size)
{
label->move(
(size.width() - label->width()) / 2,
@@ -809,11 +809,11 @@ void Content::setupContent(
_activations = [=]
{
if (!main) {
return rpl::never<Font>() | rpl::type_erased();
return rpl::never<Font>() | rpl::type_erased;
}
return rpl::merge(
main->activations()
) | rpl::type_erased();
) | rpl::type_erased;
};
_changeChosen = [=](const QString &chosen)
{
@@ -920,14 +920,14 @@ void AyuUi::FontSelectorBox::prepare() {
inner->heightValue(),
topContainer->heightValue(),
_1 + _2
) | rpl::start_with_next([=](int height)
) | rpl::on_next([=](int height)
{
accumulate_max(*max, height);
setDimensions(st::boxWidth, qMin(*max, st::boxMaxListHeight));
},
inner->lifetime());
topContainer->heightValue(
) | rpl::start_with_next([=](int height)
) | rpl::on_next([=](int height)
{
setInnerTopSkip(height);
},
@@ -947,7 +947,7 @@ void AyuUi::FontSelectorBox::prepare() {
});
inner->activations(
) | rpl::start_with_next([=](const Font &font)
) | rpl::on_next([=](const Font &font)
{
if (inner) {
inner->changeChosen(font.id);
@@ -128,7 +128,7 @@ void FillImportFiltersBox(not_null<Ui::GenericBox*> box, bool import) {
actionButton->widthValue() | rpl::filter([=]
{
return (actionButton->widthNoMargins() != buttonWidth);
}) | rpl::start_with_next([=]
}) | rpl::on_next([=]
{
actionButton->resizeToWidth(buttonWidth);
},
@@ -80,7 +80,7 @@ void MessageShotBox::setupContent() {
AyuFeatures::MessageShot::setChoosingTheme(true);
auto box = Box<ThemeSelectorBox>(_config.controller);
box->paletteSelected() | rpl::start_with_next(
box->paletteSelected() | rpl::on_next(
[=](const style::palette &palette) mutable
{
_selectedPalette->reset();
@@ -93,14 +93,14 @@ void MessageShotBox::setupContent() {
},
content->lifetime());
box->themeNameChanged() | rpl::start_with_next(
box->themeNameChanged() | rpl::on_next(
[=](const QString &name)
{
selectedTheme->force_assign(name);
},
content->lifetime());
box->boxClosing() | rpl::start_with_next(
box->boxClosing() | rpl::on_next(
[=]
{
AyuFeatures::MessageShot::setChoosingTheme(false);
@@ -115,7 +115,7 @@ void MessageShotBox::setupContent() {
st::settingsButtonNoIcon
)->toggleOn(rpl::single(_config.showBackground)
)->toggledValue(
) | start_with_next(
) | on_next(
[=](bool enabled)
{
_config.showBackground = enabled;
@@ -130,7 +130,7 @@ void MessageShotBox::setupContent() {
st::settingsButtonNoIcon
)->toggleOn(rpl::single(_config.showDate)
)->toggledValue(
) | start_with_next(
) | on_next(
[=](bool enabled)
{
_config.showDate = enabled;
@@ -145,7 +145,7 @@ void MessageShotBox::setupContent() {
st::settingsButtonNoIcon
)->toggleOn(rpl::single(_config.showReactions)
)->toggledValue(
) | start_with_next(
) | on_next(
[=](bool enabled)
{
_config.showReactions = enabled;
@@ -161,7 +161,7 @@ void MessageShotBox::setupContent() {
);
latestToggle->toggleOn(rpl::single(savedShowColorfulReplies)
)->toggledValue(
) | start_with_next(
) | on_next(
[=](bool enabled)
{
AyuSettings::set_simpleQuotesAndReplies(!enabled);
@@ -201,7 +201,7 @@ void MessageShotBox::setupContent() {
const auto boxWidth = imageView->getImage().width() / style::DevicePixelRatio() + (st::boxPadding.left() + st::boxPadding.right()) * 4;
boxClosing() | rpl::start_with_next(
boxClosing() | rpl::on_next(
[=]
{
AyuFeatures::MessageShot::resetCustomSelected();
@@ -85,7 +85,7 @@ void ThemeSelectorBox::setupContent() {
title->topValue(),
inner->widthValue(),
showAll->widthValue()
) | rpl::start_with_next([=](int top, int outerWidth, int width)
) | rpl::on_next([=](int top, int outerWidth, int width)
{
showAll->moveToRight(
st::defaultSubsectionTitlePadding.left(),
@@ -108,7 +108,7 @@ void ThemeSelectorBox::setupContent() {
0));
list->allShown(
) | rpl::start_with_next([=](bool shown)
) | rpl::on_next([=](bool shown)
{
showAll->setVisible(!shown);
},
@@ -124,7 +124,7 @@ void ThemeSelectorBox::setupContent() {
_controller->session().data().cloudThemes().refresh();
AyuFeatures::MessageShot::themeChosen(
) | rpl::start_with_next(
) | rpl::on_next(
[=](Data::CloudTheme theme)
{
const auto document = _controller->session().data().document(theme.documentId);
@@ -155,7 +155,7 @@ void ThemeSelectorBox::setupContent() {
[=]
{
return documentView->loaded();
}) | rpl::start_with_next(
}) | rpl::on_next(
[=]
{
innerCallback();
@@ -166,7 +166,7 @@ void ThemeSelectorBox::setupContent() {
lifetime());
AyuFeatures::MessageShot::paletteChosen(
) | rpl::start_with_next([=](const auto &palette)
) | rpl::on_next([=](const auto &palette)
{
_themeNames.fire(tr::ayu_MessageShotThemeDefault(tr::now));
_selectedPalette = palette;
@@ -197,7 +197,7 @@ AyuMusicButton::AyuMusicButton(
rpl::combine(
_title->naturalWidthValue(),
_performer->naturalWidthValue()
) | rpl::start_with_next([=]
) | rpl::on_next([=]
{
resizeToWidth(widthNoMargins());
},
@@ -94,7 +94,7 @@ void DeleteMyMessagesAfterConfirm(not_null<PeerData*> peer) {
if (const auto channel = peer->asChannel()) {
session->api()
.request(MTPchannels_DeleteMessages(channel->inputChannel, MTP_vector<MTPint>(ids)))
.request(MTPchannels_DeleteMessages(channel->inputChannel(), MTP_vector<MTPint>(ids)))
.done(done)
.fail(fail)
.handleFloodErrors()
@@ -115,7 +115,7 @@ void DeleteMyMessagesAfterConfirm(not_null<PeerData*> peer) {
using Flag = MTPmessages_Search::Flag;
auto request = MTPmessages_Search(
MTP_flags(Flag::f_from_id),
peer->input,
peer->input(),
MTP_string(),
MTP_inputPeerSelf(),
MTPInputPeer(),
@@ -758,7 +758,7 @@ void AddReadUntilAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
const auto ids = MTP_vector<MTPint>(1, MTP_int(item->id));
if (const auto channel = item->history()->peer->asChannel()) {
item->history()->session().api().request(MTPchannels_ReadMessageContents(
channel->inputChannel,
channel->inputChannel(),
ids
)).send();
} else {
@@ -799,7 +799,7 @@ void AddBurnAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
if (const auto channel = item->history()->peer->asChannel()) {
item->history()->session().api().request(MTPchannels_ReadMessageContents(
channel->inputChannel,
channel->inputChannel(),
ids
)).done([=]()
{
@@ -101,7 +101,7 @@ ActionWithSubText::ActionWithSubText(
setClickedCallback(std::move(callback));
paintRequest(
) | rpl::start_with_next([=]
) | rpl::on_next([=]
{
Painter p(this);
paint(p);
@@ -274,7 +274,7 @@ InnerWidget::InnerWidget(
Window::ChatThemeValueFromPeer(
controller,
peer
) | rpl::start_with_next([=](std::shared_ptr<Ui::ChatTheme> &&theme)
) | rpl::on_next([=](std::shared_ptr<Ui::ChatTheme> &&theme)
{
_theme = std::move(theme);
controller->setChatStyleTheme(_theme);
@@ -287,7 +287,7 @@ InnerWidget::InnerWidget(
scrollDateHideByTimer();
});
session().data().viewRepaintRequest(
) | rpl::start_with_next([=](auto view)
) | rpl::on_next([=](auto view)
{
if (view->delegate() == this) {
repaintItem(view);
@@ -295,7 +295,7 @@ InnerWidget::InnerWidget(
},
lifetime());
session().data().viewResizeRequest(
) | rpl::start_with_next([=](auto view)
) | rpl::on_next([=](auto view)
{
if (view->delegate() == this) {
resizeItem(view);
@@ -303,7 +303,7 @@ InnerWidget::InnerWidget(
},
lifetime());
session().data().itemViewRefreshRequest(
) | rpl::start_with_next([=](auto item)
) | rpl::on_next([=](auto item)
{
if (const auto view = viewForItem(item)) {
refreshItem(view);
@@ -311,7 +311,7 @@ InnerWidget::InnerWidget(
},
lifetime());
session().data().viewLayoutChanged(
) | rpl::start_with_next([=](auto view)
) | rpl::on_next([=](auto view)
{
if (view->delegate() == this) {
if (view->isUnderCursor()) {
@@ -321,7 +321,7 @@ InnerWidget::InnerWidget(
},
lifetime());
session().data().itemDataChanges(
) | rpl::start_with_next([=](not_null<HistoryItem*> item)
) | rpl::on_next([=](not_null<HistoryItem*> item)
{
if (const auto view = viewForItem(item)) {
view->itemDataChanged();
@@ -334,7 +334,7 @@ InnerWidget::InnerWidget(
{
return (_history == query.item->history())
&& isVisible();
}) | rpl::start_with_next([=](
}) | rpl::on_next([=](
const Data::Session::ItemVisibilityQuery &query)
{
if (const auto view = viewForItem(query.item)) {
@@ -349,7 +349,7 @@ InnerWidget::InnerWidget(
lifetime());
controller->adaptive().chatWideValue(
) | rpl::start_with_next([=](bool wide)
) | rpl::on_next([=](bool wide)
{
_isChatWide = wide;
},
@@ -157,7 +157,7 @@ Widget::Widget(
_fixedBarShadow->raise();
controller->adaptive().value(
) | rpl::start_with_next([=]
) | rpl::on_next([=]
{
updateAdaptiveLayout();
},
@@ -165,7 +165,7 @@ Widget::Widget(
_inner = _scroll->setOwnedWidget(object_ptr<InnerWidget>(this, controller, peer, item, topicId));
_inner->scrollToSignal(
) | rpl::start_with_next([=](int top)
) | rpl::on_next([=](int top)
{
_scroll->scrollToY(top);
},
@@ -174,7 +174,7 @@ Widget::Widget(
_scroll->move(0, _fixedBar->height());
_scroll->show();
_scroll->scrolls(
) | rpl::start_with_next([=]
) | rpl::on_next([=]
{
onScroll();
},
@@ -14,6 +14,7 @@
#include "base/platform/base_platform_info.h"
#include "boxes/delete_messages_box.h"
#include "core/mime_type.h"
#include "lang/lang_text_entity.h"
#include "media/audio/media_audio.h"
#include "media/view/media_view_pip.h"
#include "styles/style_boxes.h"
@@ -115,7 +116,7 @@ not_null<Ui::SlideWrap<Ui::FlatLabel>*> AddError(
st::settingLocalPasscodeError), st::settingsCheckboxPadding));
error->hide(anim::type::instant);
if (input) {
input->changes() | rpl::start_with_next(
input->changes() | rpl::on_next(
[=]
{
error->hide(anim::type::normal);
@@ -234,7 +235,7 @@ void RegexEditBuilder(
Ui::Toast::Show(Ui::Toast::Config{
.text = tr::ayu_RegexFilterBulletinText(
tr::now,
Ui::Text::RichLangValue
tr::rich
),
.filter = onClick,
.adaptive = true
@@ -244,7 +245,7 @@ void RegexEditBuilder(
});
};
regexValue->submits() | rpl::start_with_next(saveAndClose, regexValue->lifetime());
regexValue->submits() | rpl::on_next(saveAndClose, regexValue->lifetime());
box->addButton(tr::lng_settings_save(), saveAndClose);
box->addButton(tr::lng_cancel(),
[=]
@@ -74,7 +74,7 @@ void SetupAppIcon(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideNotificationBadge);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_hideNotificationBadge(enabled);
@@ -103,7 +103,7 @@ void SetupAppearance(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->materialSwitches);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_materialSwitches(enabled);
@@ -122,7 +122,7 @@ void SetupAppearance(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->removeMessageTail);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_removeMessageTail(enabled);
@@ -141,7 +141,7 @@ void SetupAppearance(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->disableCustomBackgrounds);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_disableCustomBackgrounds(enabled);
@@ -191,7 +191,7 @@ void SetupChatFolders(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideNotificationCounters);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_hideNotificationCounters(enabled);
@@ -210,7 +210,7 @@ void SetupChatFolders(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideAllChatsFolder);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_hideAllChatsFolder(enabled);
@@ -240,7 +240,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showMyProfileInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showMyProfileInDrawer(enabled);
@@ -261,7 +261,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showBotsInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showBotsInDrawer(enabled);
@@ -282,7 +282,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showNewGroupInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showNewGroupInDrawer(enabled);
@@ -302,7 +302,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showNewChannelInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showNewChannelInDrawer(enabled);
@@ -322,7 +322,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showContactsInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showContactsInDrawer(enabled);
@@ -342,7 +342,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showCallsInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showCallsInDrawer(enabled);
@@ -362,7 +362,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showSavedMessagesInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showSavedMessagesInDrawer(enabled);
@@ -382,7 +382,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showLReadToggleInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showLReadToggleInDrawer(enabled);
@@ -402,7 +402,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showSReadToggleInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showSReadToggleInDrawer(enabled);
@@ -422,7 +422,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showNightModeToggleInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showNightModeToggleInDrawer(enabled);
@@ -442,7 +442,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showGhostToggleInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showGhostToggleInDrawer(enabled);
@@ -463,7 +463,7 @@ void SetupDrawerElements(not_null<Ui::VerticalLayout*> container, not_null<Windo
[=](bool enabled)
{
return (enabled != settings->showStreamerToggleInDrawer);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showStreamerToggleInDrawer(enabled);
@@ -491,7 +491,7 @@ void SetupTrayElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showGhostToggleInTray);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showGhostToggleInTray(enabled);
@@ -511,7 +511,7 @@ void SetupTrayElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showStreamerToggleInTray);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showStreamerToggleInTray(enabled);
@@ -97,7 +97,7 @@ void SetupGhostEssentials(
[=](bool enabled)
{
return (enabled != settings->markReadAfterAction);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_markReadAfterAction(enabled);
@@ -130,7 +130,7 @@ void SetupScheduleMessages(
[=](bool enabled)
{
return (enabled != settings->useScheduledMessages);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_useScheduledMessages(enabled);
@@ -161,7 +161,7 @@ void SetupSendWithoutSound(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->sendWithoutSound);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_sendWithoutSound(enabled);
@@ -188,7 +188,7 @@ void SetupSpyEssentials(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->saveDeletedMessages);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_saveDeletedMessages(enabled);
@@ -207,7 +207,7 @@ void SetupSpyEssentials(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->saveMessagesHistory);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_saveMessagesHistory(enabled);
@@ -230,7 +230,7 @@ void SetupSpyEssentials(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->saveForBots);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_saveForBots(enabled);
@@ -255,7 +255,7 @@ void SetupOther(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->localPremium);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_localPremium(enabled);
@@ -274,7 +274,7 @@ void SetupOther(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->disableAds);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_disableAds(enabled);
@@ -6,6 +6,7 @@
// Copyright @Radolyn, 2025
#include "settings_ayu_utils.h"
#include "lang/lang_text_entity.h"
#include "settings/settings_common.h"
#include "styles/style_info.h"
#include "styles/style_layers.h"
@@ -88,7 +89,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
{
const auto separator = Ui::CreateChild<Ui::RpWidget>(container.get());
separator->paintRequest(
) | start_with_next([=, bg = st.textBgOver]
) | on_next([=, bg = st.textBgOver]
{
auto p = QPainter(separator);
p.fillRect(separator->rect(), bg);
@@ -97,7 +98,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
const auto separatorHeight = 2 * st.toggle.border
+ st.toggle.diameter;
button->geometryValue(
) | start_with_next([=](const QRect &r)
) | on_next([=](const QRect &r)
{
const auto w = st::rightsButtonToggleWidth;
constexpr auto kLineWidth = 1;
@@ -117,14 +118,14 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
const auto checkWidget = Ui::CreateChild<Ui::RpWidget>(toggleButton);
checkWidget->resize(checkView->getSize());
checkWidget->paintRequest(
) | start_with_next([=]
) | on_next([=]
{
auto p = QPainter(checkWidget);
checkView->paint(p, 0, 0, checkWidget->width());
},
checkWidget->lifetime());
toggleButton->sizeValue(
) | start_with_next([=](const QSize &s)
) | on_next([=](const QSize &s)
{
checkWidget->moveToRight(
st.toggleSkip,
@@ -137,7 +138,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
state->anyChanges.events_starting_with(
rpl::empty_value()
) | rpl::map(countChecked) | start_with_next([=](int count)
) | rpl::map(countChecked) | on_next([=](int count)
{
if (toggledWhenAll) {
checkView->setChecked(count == totalInnerChecks,
@@ -160,7 +161,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
) | rpl::map(countChecked)
) | rpl::map([=](const QString &t, int checked)
{
auto count = Ui::Text::Bold(" "
auto count = tr::bold(" "
+ QString::number(checked)
+ '/'
+ QString::number(totalInnerChecks));
@@ -173,7 +174,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
const auto &icon = st::permissionsExpandIcon;
arrow->resize(icon.size());
arrow->paintRequest(
) | start_with_next([=, &icon]
) | on_next([=, &icon]
{
auto p = QPainter(arrow);
const auto center = QPointF(
@@ -193,7 +194,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
arrow->lifetime());
}
button->sizeValue(
) | start_with_next([=, &st](const QSize &s)
) | on_next([=, &st](const QSize &s)
{
const auto labelLeft = st.padding.left();
const auto labelRight = s.width() - toggleButton->width();
@@ -210,7 +211,7 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
},
button->lifetime());
wrap->toggledValue(
) | rpl::skip(1) | start_with_next([=](bool toggled)
) | rpl::skip(1) | on_next([=](bool toggled)
{
state->animation.start(
[=]
@@ -226,14 +227,14 @@ not_null<Ui::RpWidget*> AddInnerToggle(not_null<Ui::VerticalLayout*> container,
wrap->ease = anim::easeOutCubic;
button->clicks(
) | start_with_next([=]
) | on_next([=]
{
wrap->toggle(!wrap->toggled(), anim::type::normal);
},
button->lifetime());
toggleButton->clicks(
) | start_with_next([=]
) | on_next([=]
{
const auto checked = !checkView->checked();
for (const auto &innerCheck : state->innerChecks) {
@@ -270,7 +271,7 @@ void AddCollapsibleToggle(not_null<Ui::VerticalLayout*> container,
combine(
verticalLayout->widthValue(),
checkbox->geometryValue()
) | start_with_next([=](int w, const QRect &r)
) | on_next([=](int w, const QRect &r)
{
button->setGeometry(0, r.y(), w, r.height());
},
@@ -287,7 +288,7 @@ void AddCollapsibleToggle(not_null<Ui::VerticalLayout*> container,
return checkView;
}();
checkView->checkedChanges(
) | start_with_next([=](bool checked)
) | on_next([=](bool checked)
{
},
verticalLayout->lifetime());
@@ -303,7 +304,7 @@ void AddCollapsibleToggle(not_null<Ui::VerticalLayout*> container,
for (const auto &entry : checkboxes) {
const auto c = addCheckbox(verticalLayout, entry.checkboxLabel, entry.initial);
c->checkedValue(
) | start_with_next([=](bool enabled)
) | on_next([=](bool enabled)
{
entry.callback(enabled);
},
@@ -322,7 +323,7 @@ void AddCollapsibleToggle(not_null<Ui::VerticalLayout*> container,
toggledWhenAll);
container->add(std::move(wrap));
container->widthValue(
) | start_with_next([=](int w)
) | on_next([=](int w)
{
raw->resizeToWidth(w);
},
@@ -55,7 +55,7 @@ void SetupStickersAndEmojiSettings(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showOnlyAddedEmojisAndStickers);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showOnlyAddedEmojisAndStickers(enabled);
@@ -172,7 +172,7 @@ void SetupGroupsAndChannels(not_null<Ui::VerticalLayout*> container, not_null<Wi
[=](bool enabled)
{
return (enabled != settings->quickAdminShortcuts);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_quickAdminShortcuts(enabled);
@@ -191,7 +191,7 @@ void SetupGroupsAndChannels(not_null<Ui::VerticalLayout*> container, not_null<Wi
[=](bool enabled)
{
return (enabled != settings->showMessageShot);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_showMessageShot(enabled);
@@ -262,7 +262,7 @@ void SetupMarks(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->replaceBottomInfoWithIcons);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_replaceBottomInfoWithIcons(enabled);
@@ -285,7 +285,7 @@ void SetupMarks(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideFastShare);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_hideFastShare(enabled);
@@ -304,7 +304,7 @@ void SetupMarks(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->simpleQuotesAndReplies);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_simpleQuotesAndReplies(enabled);
@@ -520,7 +520,7 @@ void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showAttachButtonInMessageField);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showAttachButtonInMessageField(enabled);
@@ -540,7 +540,7 @@ void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showCommandsButtonInMessageField);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showCommandsButtonInMessageField(enabled);
@@ -560,7 +560,7 @@ void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showAutoDeleteButtonInMessageField);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showAutoDeleteButtonInMessageField(enabled);
@@ -580,7 +580,7 @@ void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showEmojiButtonInMessageField);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showEmojiButtonInMessageField(enabled);
@@ -600,7 +600,7 @@ void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showMicrophoneButtonInMessageField);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showMicrophoneButtonInMessageField(enabled);
@@ -630,7 +630,7 @@ void SetupMessageFieldPopups(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showAttachPopup);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showAttachPopup(enabled);
@@ -650,7 +650,7 @@ void SetupMessageFieldPopups(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->showEmojiPopup);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_showEmojiPopup(enabled);
@@ -138,7 +138,7 @@ void SetupFiltersSettings(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->filtersEnabled);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_filtersEnabled(enabled);
@@ -160,7 +160,7 @@ void SetupFiltersSettings(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->filtersEnabledInChats);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_filtersEnabledInChats(enabled);
@@ -183,7 +183,7 @@ void SetupFiltersSettings(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideFromBlocked);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_hideFromBlocked(enabled);
@@ -266,7 +266,7 @@ void SetupMessageFilters(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->hideFromBlocked);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_hideFromBlocked(enabled);
@@ -155,7 +155,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->disableStories);
}) | rpl::start_with_next(
}) | rpl::on_next(
[=](bool enabled)
{
AyuSettings::set_disableStories(enabled);
@@ -193,7 +193,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
) | rpl::filter([=](bool enabled)
{
return (enabled != settings->disableNotificationsDelay);
}) | start_with_next([=](bool enabled)
}) | on_next([=](bool enabled)
{
AyuSettings::set_disableNotificationsDelay(enabled);
AyuSettings::save();
@@ -215,7 +215,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->showMessageSeconds);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_showMessageSeconds(enabled);
@@ -242,7 +242,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->spoofWebviewAsAndroid);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_spoofWebviewAsAndroid(enabled);
@@ -287,7 +287,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->stickerConfirmation);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_stickerConfirmation(enabled);
@@ -306,7 +306,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->gifConfirmation);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_gifConfirmation(enabled);
@@ -325,7 +325,7 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container, not_null<Window::S
[=](bool enabled)
{
return (enabled != settings->voiceConfirmation);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_voiceConfirmation(enabled);
@@ -56,7 +56,7 @@ void SetupAppLogo(not_null<Ui::VerticalLayout*> container) {
logo->setNaturalWidth(st::settingsCloudPasswordIconSize);
logo->paintRequest(
) | rpl::start_with_next([=](QRect clip)
) | rpl::on_next([=](QRect clip)
{
auto p = QPainter(logo);
const auto image = AyuAssets::currentAppLogoPad();
@@ -88,7 +88,7 @@ QImage getImage(const QString &name) {
auto icon = getImage(name);
iconWidget->resize(icon.size() / style::DevicePixelRatio());
iconWidget->paintRequest(
) | rpl::start_with_next([=]
) | rpl::on_next([=]
{
auto p = QPainter(iconWidget);
p.drawImage(0, 0, icon);
@@ -96,7 +96,7 @@ QImage getImage(const QString &name) {
iconWidget->lifetime());
button->sizeValue(
) | rpl::start_with_next([=](const QSize &s)
) | rpl::on_next([=](const QSize &s)
{
iconWidget->moveToLeft(
button->st().iconLeft
@@ -168,7 +168,7 @@ void SetupDonations(not_null<Ui::VerticalLayout*> container, not_null<Window::Se
rpl::single(
Ui::Text::Link(tr::ayu_SupportDescription1(tr::now), QString("tg://support"))
),
Ui::Text::WithEntities
tr::marked
)
);
}
@@ -191,7 +191,7 @@ void SetupCrashReporting(not_null<Ui::VerticalLayout*> container) {
[=](bool enabled)
{
return (enabled != settings->crashReporting);
}) | start_with_next(
}) | on_next(
[=](bool enabled)
{
AyuSettings::set_crashReporting(enabled);
@@ -222,7 +222,7 @@ void SetupOtherThings(not_null<Ui::VerticalLayout*> container, not_null<Window::
)->setClickedCallback([=]
{
controller->show(Ui::MakeConfirmBox({
.text = tr::ayu_ResetSettingsConfirmation(Ui::Text::RichLangValue),
.text = tr::ayu_ResetSettingsConfirmation(tr::rich),
.confirmed = [=](Fn<void()> &&close)
{
AyuSettings::reset();
@@ -8,6 +8,7 @@
#include "ayu/ayu_settings.h"
#include "ayu/utils/telegram_helpers.h"
#include "data/data_peer.h"
#include "lang/lang_text_entity.h"
#include "ui/text/text_utilities.h"
constexpr auto kMaxChannelId = -1000000000000;
@@ -32,9 +33,9 @@ QString IDString(MsgId topicRootId) {
}
rpl::producer<TextWithEntities> IDValue(not_null<PeerData*> peer) {
return rpl::single(IDString(peer)) | Ui::Text::ToWithEntities();
return rpl::single(tr::marked(IDString(peer)));
}
rpl::producer<TextWithEntities> IDValue(MsgId topicRootId) {
return rpl::single(IDString(topicRootId)) | Ui::Text::ToWithEntities();
return rpl::single(tr::marked(IDString(topicRootId)));
}
@@ -164,31 +164,31 @@ Fn<void()> badgeClickHandler(not_null<PeerData*> peer) {
tr::now,
lt_item,
TextWithEntities{peer->name()},
Ui::Text::RichLangValue)
tr::rich)
: tr::ayu_SupporterPopup(
tr::now,
lt_item,
TextWithEntities{peer->name()},
Ui::Text::RichLangValue))
: Ui::Text::RichLangValue(custom.text);
tr::rich))
: tr::rich(custom.text);
} else if (isExtera) {
text = peer->isUser()
? tr::ayu_DeveloperPopup(
tr::now,
lt_item,
TextWithEntities{peer->name()},
Ui::Text::RichLangValue)
tr::rich)
: tr::ayu_OfficialResourcePopup(
tr::now,
lt_item,
TextWithEntities{peer->name()},
Ui::Text::RichLangValue);
tr::rich);
} else if (isSupporter) {
text = tr::ayu_SupporterPopup(
tr::now,
lt_item,
TextWithEntities{peer->name()},
Ui::Text::RichLangValue);
tr::rich);
} else {
return;
}
@@ -231,7 +231,7 @@ void readMentions(base::weak_ptr<Data::Thread> weakThread) {
using Flag = MTPmessages_ReadMentions::Flag;
peer->session().api().request(MTPmessages_ReadMentions(
MTP_flags(rootId ? Flag::f_top_msg_id : Flag()),
peer->input,
peer->input(),
MTP_int(rootId)
)).done([=](const MTPmessages_AffectedHistory &result)
{
@@ -258,9 +258,9 @@ void readReactions(base::weak_ptr<Data::Thread> weakThread) {
using Flag = MTPmessages_ReadReactions::Flag;
peer->session().api().request(MTPmessages_ReadReactions(
MTP_flags(rootId ? Flag::f_top_msg_id : Flag(0)),
peer->input,
peer->input(),
MTP_int(rootId),
sublist ? sublist->sublistPeer()->input : MTPInputPeer()
sublist ? sublist->sublistPeer()->input() : MTPInputPeer()
)).done([=](const MTPmessages_AffectedHistory &result)
{
const auto offset = peer->session().api().applyAffectedHistory(
@@ -329,13 +329,13 @@ void readHistory(not_null<HistoryItem*> message) {
{
if (const auto channel = history->peer->asChannel()) {
return history->session().api().request(MTPchannels_ReadHistory(
channel->inputChannel,
channel->inputChannel(),
MTP_int(tillId)
)).done([=] { AyuWorker::markAsOnline(&history->session()); }).send();
}
return history->session().api().request(MTPmessages_ReadHistory(
history->peer->input,
history->peer->input(),
MTP_int(tillId)
)).done([=](const MTPmessages_AffectedMessages &result)
{
@@ -688,7 +688,7 @@ void searchPeerInner(const QString &peerId, Main::Session *session, const Userna
session->api().request(MTPmessages_GetInlineBotResults(
MTP_flags(0),
bot->inputUser,
bot->inputUser(),
MTP_inputPeerEmpty(),
MTPInputGeoPoint(),
MTP_string(peerId),
@@ -1060,7 +1060,7 @@ void getUserRegistrationDateInner(
session->api().request(MTPmessages_GetInlineBotResults(
MTP_flags(0),
bot->inputUser,
bot->inputUser(),
MTP_inputPeerEmpty(),
MTPInputGeoPoint(),
MTP_string(qsl("regdate ") + QString::number(userId)),
@@ -1144,14 +1144,14 @@ void getUserRegistrationDateInner(
TextWithEntities{userName},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
} else {
resultText = tr::ayu_CreationDateSelfApproximately(
tr::now,
lt_item,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
}
} else if (flag == "LT") {
@@ -1162,14 +1162,14 @@ void getUserRegistrationDateInner(
TextWithEntities{userName},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
} else {
resultText = tr::ayu_CreationDateSelfEarlier(
tr::now,
lt_item,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
}
} else if (flag == "ET") {
@@ -1180,14 +1180,14 @@ void getUserRegistrationDateInner(
TextWithEntities{userName},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
} else {
resultText = tr::ayu_CreationDateSelfLater(
tr::now,
lt_item,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
}
}
@@ -1234,7 +1234,7 @@ void getChannelJoinOrCreateDate(not_null<ChannelData*> channel, Fn<void(TextWith
TextWithEntities{channel->name()},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
} else if (channel->date) {
const auto formattedDate = langDayOfMonthFull(base::unixtime::parse(channel->date).date());
@@ -1244,7 +1244,7 @@ void getChannelJoinOrCreateDate(not_null<ChannelData*> channel, Fn<void(TextWith
TextWithEntities{channel->name()},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
}
@@ -1264,7 +1264,7 @@ void getChatCreateDate(not_null<ChatData*> chat, Fn<void(TextWithEntities)> call
TextWithEntities{chat->name()},
lt_item2,
TextWithEntities{formattedDate},
Ui::Text::RichLangValue
tr::rich
);
}
+6 -6
View File
@@ -46,7 +46,7 @@ rpl::producer<TextWithEntities> Text() {
rpl::single(Ui::Text::Link(
"GitHub",
"https://github.com/AyuGram/AyuGramDesktop")),
Ui::Text::WithEntities);
tr::marked);
}
} // namespace
@@ -136,7 +136,7 @@ void ArchiveHintBox(
owned->setNaturalWidth(rect.width());
const auto widget = box->addRow(std::move(owned), style::al_top);
widget->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = Painter(widget);
auto hq = PainterHighQualityEnabler(p);
p.setPen(Qt::NoPen);
@@ -167,11 +167,11 @@ void ArchiveHintBox(
lt_emoji,
rpl::single(
Ui::Text::IconEmoji(&st::textMoreIconEmoji)),
Ui::Text::RichLangValue
tr::rich
) | rpl::map([](TextWithEntities text) {
return Ui::Text::Link(std::move(text), 1);
}),
Ui::Text::RichLangValue),
tr::rich),
st::channelEarnHistoryRecipientLabel));
label->resizeToWidth(box->width()
- rect::m::sum::h(st::boxRowPadding));
@@ -213,13 +213,13 @@ void ArchiveHintBox(
const auto left = Ui::CreateChild<Ui::RpWidget>(
box->verticalLayout().get());
left->paintRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
auto p = Painter(left);
icon.paint(p, 0, 0, left->width());
}, left->lifetime());
left->resize(icon.size());
top->geometryValue(
) | rpl::start_with_next([=](const QRect &g) {
) | rpl::on_next([=](const QRect &g) {
left->moveToLeft(
(g.left() - left->width()) / 2,
g.top() + st::channelEarnHistoryThreeSkip);
@@ -2049,7 +2049,7 @@ void SendFilesBox::setupDragForBlock(not_null<Ui::RpWidget*> w, int index) {
const auto pressPos = w->lifetime().make_state<rpl::variable<QPoint>>();
w->events(
) | rpl::start_with_next(
) | rpl::on_next(
[=](not_null<QEvent *> e)
{
switch (e->type()) {
+1 -1
View File
@@ -262,7 +262,7 @@ void TranslateBox(
tr::italic(tr::lng_translate_box_error(tr::now)));
}).send();
box->boxClosing() | rpl::start_with_next([=]
box->boxClosing() | rpl::on_next([=]
{
Ayu::Translator::TranslateManager::currentInstance()->cancel(reqId);
}, box->lifetime());
@@ -1315,7 +1315,7 @@ std::unique_ptr<Ui::AbstractButton> AyuForwardWriteRestriction(
subtitle->show();
raw->sizeValue() | rpl::start_with_next([=](QSize size) {
raw->sizeValue() | rpl::on_next([=](QSize size) {
const auto toggle = [&](auto &&widget, bool shown) {
if (widget->isHidden() == shown) {
+1 -1
View File
@@ -24,5 +24,5 @@ constexpr auto AppName = "AyuGram Desktop"_cs;
constexpr auto AppFile = "AyuGram"_cs;
constexpr auto AppVersion = 6003010;
constexpr auto AppVersionStr = "6.3.10";
constexpr auto AppBetaVersion = true;
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
@@ -460,7 +460,7 @@ HistoryInner::HistoryInner(
}, _scroll->lifetime());
_controller->window().widget()->globalForceClicks() |
rpl::start_with_next(
rpl::on_next(
[=](QPoint globalPosition)
{
auto mousePos = mapFromGlobal(globalPosition);
@@ -406,7 +406,7 @@ HistoryWidget::HistoryWidget(
}
_unblock->addClickHandler([=] { unblockUser(); });
_botStart->setAcceptBoth(true);
_botStart->clicks() | rpl::start_with_next(
_botStart->clicks() | rpl::on_next(
[=](Qt::MouseButton button)
{
if (button == Qt::LeftButton) {
@@ -665,7 +665,7 @@ HistoryWidget::HistoryWidget(
Data::PeerUpdate::Flag::IsBlocked
) | rpl::to_empty,
AyuSettings::get_filtersUpdate()
) | rpl::start_with_next(
) | rpl::on_next(
[=]
{
crl::on_main(
@@ -796,7 +796,7 @@ HistoryWidget::HistoryWidget(
}
}, lifetime());
AyuSettings::get_historyUpdateReactive() | rpl::start_with_next([=]
AyuSettings::get_historyUpdateReactive() | rpl::on_next([=]
{
refreshAttachBotsMenu();
updateHistoryGeometry();
@@ -1045,7 +1045,7 @@ HistoryWidget::HistoryWidget(
confirmDeleteSelected();
}, _topBar->lifetime());
_topBar->messageShotSelectionRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
messageShotSelected();
}, _topBar->lifetime());
_topBar->clearSelectionRequest(
@@ -9394,7 +9394,7 @@ void HistoryWidget::messageShotSelected() {
messages
};
auto box = Box<MessageShotBox>(config);
box->boxClosing() | rpl::start_with_next([=]
box->boxClosing() | rpl::on_next([=]
{
clearSelected();
}, box->lifetime());
@@ -2190,7 +2190,7 @@ void ComposeControls::init() {
updateAttachBotsMenu();
}, _wrap->lifetime());
AyuSettings::get_historyUpdateReactive() | rpl::start_with_next([=]
AyuSettings::get_historyUpdateReactive() | rpl::on_next([=]
{
updateSendButtonType();
updateControlsVisibility();
@@ -521,7 +521,7 @@ void BottomInfo::layoutDateText() {
const auto prefix = !author.isEmpty() ? (_data.flags & Data::Flag::Edited ? u" "_q : u", "_q) : QString();
const auto dateStr = (_data.flags & Data::Flag::ForwardedDate)
? Ui::FormatDateTimeSavedFrom(_data.date, true)
? Ui::FormatDateTimeSavedFrom(_data.date)
: formatMessageTime(_data.date.time());
const auto date = TextWithEntities{}
@@ -319,7 +319,7 @@ ChatWidget::ChatWidget(
confirmDeleteSelected();
}, _topBar->lifetime());
_topBar->messageShotSelectionRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
AyuFeatures::MessageShot::Wrapper(_inner, [=] { clearSelected(); });
}, _topBar->lifetime());
_topBar->forwardSelectionRequest(
@@ -154,7 +154,7 @@ PinnedWidget::PinnedWidget(
confirmDeleteSelected();
}, _topBar->lifetime());
_topBar->messageShotSelectionRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
AyuFeatures::MessageShot::Wrapper(_inner, [=] { clearSelected(); });
}, _topBar->lifetime());
_topBar->forwardSelectionRequest(
@@ -206,7 +206,7 @@ ScheduledWidget::ScheduledWidget(
confirmDeleteSelected();
}, _topBar->lifetime());
_topBar->messageShotSelectionRequest(
) | rpl::start_with_next([=] {
) | rpl::on_next([=] {
AyuFeatures::MessageShot::Wrapper(_inner, [=] { clearSelected(); });
}, _topBar->lifetime());
_topBar->clearSelectionRequest(
@@ -750,7 +750,7 @@ void WrapWidget::finishShowContent() {
updateContentGeometry();
}, _content->lifetime());
AyuSettings::get_filtersUpdate() | rpl::start_with_next([=]
AyuSettings::get_filtersUpdate() | rpl::on_next([=]
{
auto contentMemento = _content->createMemento();
if (!contentMemento) {
@@ -203,7 +203,7 @@ void Badge::setContent(Content content) {
icon->width() + skip,
icon->height());
_view->paintRequest(
) | rpl::start_with_next([=, check = _view.data()]{
) | rpl::on_next([=, check = _view.data()]{
Painter p(check);
if (_overrideSt) {
icon->paint(p, skip, 0, check->width(), _overrideSt->premiumFg->c);
@@ -100,7 +100,7 @@ void SetupSavedMusic(
musicButton->entity()->clicks() | rpl::filter([=](Qt::MouseButton mouseButton)
{
return mouseButton == Qt::RightButton;
}) | rpl::start_with_next([=]
}) | rpl::on_next([=]
{
const auto &settings = AyuSettings::getInstance();
@@ -136,7 +136,7 @@ void SetupSavedMusic(
musicButton->lifetime());
const auto weak = base::make_weak(musicButton);
musicButton->entity()->onReady() | rpl::start_with_next(
musicButton->entity()->onReady() | rpl::on_next(
[=]
{
// fix animation glitch
+1 -1
View File
@@ -126,7 +126,7 @@ void InitializeBlockedPeers(not_null<Main::Session*> session) {
session->api().blockedPeers().slice(
) | rpl::take(
1
) | rpl::start_with_next([=](const Api::BlockedPeers::Slice &result) {
) | rpl::on_next([=](const Api::BlockedPeers::Slice &result) {
applySlice(result, applySlice);
}, session->lifetime());
}
@@ -1719,7 +1719,7 @@ void SetupDefaultThemes(
}, block->lifetime());
if (AyuFeatures::MessageShot::isChoosingTheme()) {
palette->selected() | rpl::start_with_next(
palette->selected() | rpl::on_next(
[=](QColor color)
{
AyuFeatures::MessageShot::setDefaultSelectedColor(color);
@@ -1735,7 +1735,7 @@ void SetupDefaultThemes(
},
container->lifetime());
AyuFeatures::MessageShot::resetDefaultSelectedEvents() | rpl::start_with_next([=]
AyuFeatures::MessageShot::resetDefaultSelectedEvents() | rpl::on_next([=]
{
refreshColorizer(AyuFeatures::MessageShot::getSelectedFromDefault()); // hide colorizer
group->setValue(Type(-1));
@@ -1207,7 +1207,7 @@ base::weak_qptr<Ui::RpWidget> Premium::createPinnedToTop(
const auto &settings = AyuSettings::getInstance();
if (settings.localPremium) {
return tr::ayu_LocalPremiumNotice(Ui::Text::RichLangValue);
return tr::ayu_LocalPremiumNotice(tr::rich);
}
return rpl::conditional(
@@ -347,7 +347,7 @@ void CloudList::setup() {
});
if (AyuFeatures::MessageShot::isChoosingTheme()) {
AyuFeatures::MessageShot::resetCustomSelectedEvents() | rpl::start_with_next([=] {
AyuFeatures::MessageShot::resetCustomSelectedEvents() | rpl::on_next([=] {
_group->setValue(-1);
}, _outer->lifetime());
}
@@ -838,7 +838,7 @@ void MainMenu::setupMenu() {
)->toggleOn(AyuSettings::get_ghostModeEnabledReactive());
ghostModeToggle->toggledChanges(
) | rpl::start_with_next(
) | rpl::on_next(
[=](bool ghostMode)
{
AyuSettings::set_ghostModeEnabled(ghostMode);
@@ -854,7 +854,7 @@ void MainMenu::setupMenu() {
)->toggleOn(rpl::single(AyuFeatures::StreamerMode::isEnabled()));
streamerModeToggle->toggledChanges(
) | rpl::start_with_next(
) | rpl::on_next(
[=](bool enabled)
{
if (enabled) {
+1 -1
View File
@@ -2,6 +2,6 @@ AppVersion 6003010
AppVersionStrMajor 6.3
AppVersionStrSmall 6.3.10
AppVersionStr 6.3.10
BetaChannel 1
BetaChannel 0
AlphaVersion 0
AppVersionOriginal 6.3.10.beta