mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v6.3.10' & extra into dev
This commit is contained in:
@@ -89,7 +89,7 @@ public:
|
||||
AbstractButton::setDisabled(true);
|
||||
|
||||
const auto processTooltip = [=](not_null<Ui::RpWidget*> w) {
|
||||
w->events() | rpl::start_with_next([=](not_null<QEvent*> e) {
|
||||
w->events() | rpl::on_next([=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::Enter) {
|
||||
Ui::Tooltip::Show(1000, this);
|
||||
} else if (e->type() == QEvent::Leave) {
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
this,
|
||||
st::defaultRippleAnimationBgOver);
|
||||
plus->resize(Size(st::ivZoomButtonsSize));
|
||||
plus->paintRequest() | rpl::start_with_next([=, fg = _st.itemFg] {
|
||||
plus->paintRequest() | rpl::on_next([=, fg = _st.itemFg] {
|
||||
auto p = QPainter(plus);
|
||||
p.setPen(fg);
|
||||
p.setFont(st::normalFont);
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
this,
|
||||
st::defaultRippleAnimationBgOver);
|
||||
minus->resize(Size(st::ivZoomButtonsSize));
|
||||
minus->paintRequest() | rpl::start_with_next([=, fg = _st.itemFg] {
|
||||
minus->paintRequest() | rpl::on_next([=, fg = _st.itemFg] {
|
||||
auto p = QPainter(minus);
|
||||
const auto r = minus->rect();
|
||||
p.setPen(fg);
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
}
|
||||
|
||||
_delegate->ivZoomValue(
|
||||
) | rpl::start_with_next([this](int value) {
|
||||
) | rpl::on_next([this](int value) {
|
||||
_text.setText(_st.itemStyle, QString::number(value) + '%');
|
||||
update();
|
||||
}, lifetime());
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
rpl::combine(
|
||||
sizeValue(),
|
||||
reset->sizeValue()
|
||||
) | rpl::start_with_next([=](const QSize &size, const QSize &) {
|
||||
) | rpl::on_next([=](const QSize &size, const QSize &) {
|
||||
reset->setFullWidth(0
|
||||
+ resetLabel->width()
|
||||
+ st::ivResetZoomInnerPadding);
|
||||
@@ -424,7 +424,7 @@ void Controller::updateTitleGeometry(int newWidth) const {
|
||||
0,
|
||||
newWidth,
|
||||
st::ivSubtitleHeight);
|
||||
_subtitleWrap->paintRequest() | rpl::start_with_next([=](QRect clip) {
|
||||
_subtitleWrap->paintRequest() | rpl::on_next([=](QRect clip) {
|
||||
QPainter(_subtitleWrap.get()).fillRect(clip, st::windowBg);
|
||||
}, _subtitleWrap->lifetime());
|
||||
|
||||
@@ -466,7 +466,7 @@ void Controller::initControls() {
|
||||
return prefix + ' ' + QChar(0x2014) + ' ' + subtitle;
|
||||
});
|
||||
_windowTitleText.value(
|
||||
) | rpl::start_with_next([=](const QString &title) {
|
||||
) | rpl::on_next([=](const QString &title) {
|
||||
_window->setWindowTitle(title);
|
||||
}, _subtitle->lifetime());
|
||||
|
||||
@@ -495,7 +495,7 @@ void Controller::initControls() {
|
||||
});
|
||||
|
||||
_back->toggledValue(
|
||||
) | rpl::start_with_next([=](bool toggled) {
|
||||
) | rpl::on_next([=](bool toggled) {
|
||||
_subtitleBackShift.start(
|
||||
[=] { updateTitleGeometry(_window->body()->width()); },
|
||||
toggled ? 0. : 1.,
|
||||
@@ -505,7 +505,7 @@ void Controller::initControls() {
|
||||
_back->hide(anim::type::instant);
|
||||
|
||||
_forward->toggledValue(
|
||||
) | rpl::start_with_next([=](bool toggled) {
|
||||
) | rpl::on_next([=](bool toggled) {
|
||||
_subtitleForwardShift.start(
|
||||
[=] { updateTitleGeometry(_window->body()->width()); },
|
||||
toggled ? 0. : 1.,
|
||||
@@ -577,7 +577,7 @@ QByteArray Controller::fillInChannelValuesScript(
|
||||
auto result = QByteArray();
|
||||
for (auto &[id, in] : inChannelValues) {
|
||||
if (_inChannelSubscribed.emplace(id).second) {
|
||||
std::move(in) | rpl::start_with_next([=](bool in) {
|
||||
std::move(in) | rpl::on_next([=](bool in) {
|
||||
if (_ready) {
|
||||
_webview->eval(toggleInChannelScript(id, in));
|
||||
} else {
|
||||
@@ -609,13 +609,13 @@ void Controller::createWindow() {
|
||||
) | rpl::filter([=](QWindow *focused) {
|
||||
const auto handle = window->window()->windowHandle();
|
||||
return _webview && handle && (focused == handle);
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
setInnerFocus();
|
||||
}, window->lifetime());
|
||||
|
||||
initControls();
|
||||
|
||||
window->body()->widthValue() | rpl::start_with_next([=](int width) {
|
||||
window->body()->widthValue() | rpl::on_next([=](int width) {
|
||||
updateTitleGeometry(width);
|
||||
}, _subtitle->lifetime());
|
||||
|
||||
@@ -624,7 +624,7 @@ void Controller::createWindow() {
|
||||
|
||||
window->geometryValue(
|
||||
) | rpl::distinct_until_changed(
|
||||
) | rpl::skip(1) | rpl::start_with_next([=] {
|
||||
) | rpl::skip(1) | rpl::on_next([=] {
|
||||
_delegate->ivSaveGeometry(window);
|
||||
}, window->lifetime());
|
||||
|
||||
@@ -632,12 +632,12 @@ void Controller::createWindow() {
|
||||
rpl::combine(
|
||||
window->body()->sizeValue(),
|
||||
_subtitleWrap->heightValue()
|
||||
) | rpl::start_with_next([=](QSize size, int title) {
|
||||
) | rpl::on_next([=](QSize size, int title) {
|
||||
_container->setGeometry(QRect(QPoint(), size).marginsRemoved(
|
||||
{ 0, title, 0, 0 }));
|
||||
}, _container->lifetime());
|
||||
|
||||
_container->paintRequest() | rpl::start_with_next([=](QRect clip) {
|
||||
_container->paintRequest() | rpl::on_next([=](QRect clip) {
|
||||
QPainter(_container).fillRect(clip, st::windowBg);
|
||||
}, _container->lifetime());
|
||||
|
||||
@@ -665,13 +665,13 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
|
||||
if (const auto webviewZoomController = raw->zoomController()) {
|
||||
webviewZoomController->zoomValue(
|
||||
) | rpl::start_with_next([this](int value) {
|
||||
) | rpl::on_next([this](int value) {
|
||||
if (value > 0) {
|
||||
_delegate->ivSetZoom(value);
|
||||
}
|
||||
}, lifetime());
|
||||
_delegate->ivZoomValue(
|
||||
) | rpl::start_with_next([=](int value) {
|
||||
) | rpl::on_next([=](int value) {
|
||||
webviewZoomController->setZoom(value);
|
||||
}, lifetime());
|
||||
}
|
||||
@@ -682,7 +682,7 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
});
|
||||
|
||||
window->events(
|
||||
) | rpl::start_with_next([=](not_null<QEvent*> e) {
|
||||
) | rpl::on_next([=](not_null<QEvent*> e) {
|
||||
if (e->type() == QEvent::Close) {
|
||||
close();
|
||||
} else if (e->type() == QEvent::KeyPress) {
|
||||
@@ -737,7 +737,7 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
});
|
||||
|
||||
_container->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize size) {
|
||||
) | rpl::on_next([=](QSize size) {
|
||||
if (const auto widget = raw->widget()) {
|
||||
widget->setGeometry(QRect(QPoint(), size));
|
||||
}
|
||||
@@ -826,7 +826,7 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
Lang::Updated(),
|
||||
style::PaletteChanged(),
|
||||
_delegate->ivZoomValue() | rpl::to_empty
|
||||
) | rpl::start_with_next([=] {
|
||||
) | rpl::on_next([=] {
|
||||
_updateStyles.call();
|
||||
}, _webview->lifetime());
|
||||
}
|
||||
@@ -885,7 +885,7 @@ void Controller::createWebview(const Webview::StorageId &storageId) {
|
||||
});
|
||||
|
||||
raw->navigationHistoryState(
|
||||
) | rpl::start_with_next([=](Webview::NavigationHistoryState state) {
|
||||
) | rpl::on_next([=](Webview::NavigationHistoryState state) {
|
||||
_back->toggle(
|
||||
state.canGoBack || state.canGoForward,
|
||||
anim::type::normal);
|
||||
@@ -934,12 +934,12 @@ void Controller::showWebviewError(TextWithEntities text) {
|
||||
});
|
||||
wrap->show();
|
||||
|
||||
wrap->widthValue() | rpl::start_with_next([=](int width) {
|
||||
wrap->widthValue() | rpl::on_next([=](int width) {
|
||||
error->resizeToWidth(width);
|
||||
wrap->resize(width, error->height());
|
||||
}, wrap->lifetime());
|
||||
|
||||
_container->sizeValue() | rpl::start_with_next([=](QSize size) {
|
||||
_container->sizeValue() | rpl::on_next([=](QSize size) {
|
||||
wrap->setGeometry(0, 0, size.width(), size.height() * 2 / 3);
|
||||
}, wrap->lifetime());
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ void Controller::showShareMenu() {
|
||||
_window->body().get(),
|
||||
Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint));
|
||||
}
|
||||
_window->body()->sizeValue() | rpl::start_with_next([=](QSize size) {
|
||||
_window->body()->sizeValue() | rpl::on_next([=](QSize size) {
|
||||
const auto widget = _shareHidesContent
|
||||
? _shareWrap.get()
|
||||
: _shareContainer.get();
|
||||
@@ -1233,7 +1233,7 @@ void Controller::showShareMenu() {
|
||||
_shareFocus = result.focus;
|
||||
_shareHide = result.hide;
|
||||
|
||||
std::move(result.destroyRequests) | rpl::start_with_next([=] {
|
||||
std::move(result.destroyRequests) | rpl::on_next([=] {
|
||||
destroyShareMenu();
|
||||
}, _shareWrap->lifetime());
|
||||
|
||||
|
||||
@@ -326,13 +326,13 @@ ShareBoxResult Shown::shareBox(ShareBoxDescriptor &&descriptor) {
|
||||
layer->setHideByBackgroundClick(false);
|
||||
layer->move(0, 0);
|
||||
wrap->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize size) {
|
||||
) | rpl::on_next([=](QSize size) {
|
||||
layer->resize(size);
|
||||
}, layer->lifetime());
|
||||
layer->hideFinishEvents(
|
||||
) | rpl::filter([=] {
|
||||
return !!lookup(); // Last hide finish is sent from destructor.
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
state->destroyRequests.fire({});
|
||||
}, wrap->lifetime());
|
||||
|
||||
@@ -357,7 +357,7 @@ ShareBoxResult Shown::shareBox(ShareBoxDescriptor &&descriptor) {
|
||||
) | rpl::filter([=](QWindow *focused) {
|
||||
const auto handle = layer->window()->windowHandle();
|
||||
return handle && (focused == handle);
|
||||
}) | rpl::start_with_next([=] {
|
||||
}) | rpl::on_next([=] {
|
||||
waiting->destroy();
|
||||
set();
|
||||
});
|
||||
@@ -388,7 +388,7 @@ void Shown::createController() {
|
||||
) | rpl::start_to_stream(_events, _controller->lifetime());
|
||||
|
||||
_controller->dataRequests(
|
||||
) | rpl::start_with_next([=](Webview::DataRequest request) {
|
||||
) | rpl::on_next([=](Webview::DataRequest request) {
|
||||
const auto requested = QString::fromStdString(request.id);
|
||||
const auto id = QStringView(requested);
|
||||
if (id.startsWith(u"photo/")) {
|
||||
@@ -507,7 +507,7 @@ void Shown::streamFile(
|
||||
}).first->second;
|
||||
|
||||
file.loader->parts(
|
||||
) | rpl::start_with_next([=](Media::Streaming::LoadedPart &&part) {
|
||||
) | rpl::on_next([=](Media::Streaming::LoadedPart &&part) {
|
||||
const auto i = _streams.find(documentId);
|
||||
Assert(i != end(_streams));
|
||||
processPartInFile(i->second, std::move(part));
|
||||
@@ -552,7 +552,7 @@ void Shown::subscribeToDocuments() {
|
||||
_documentLifetime = _session->data().documentLoadProgress(
|
||||
) | rpl::filter([=](not_null<DocumentData*> document) {
|
||||
return !document->loading();
|
||||
}) | rpl::start_with_next([=](not_null<DocumentData*> document) {
|
||||
}) | rpl::on_next([=](not_null<DocumentData*> document) {
|
||||
const auto i = _files.find(document->id);
|
||||
if (i == end(_files)) {
|
||||
return;
|
||||
@@ -858,7 +858,7 @@ void Instance::show(
|
||||
}
|
||||
_shown = std::make_unique<Shown>(_delegate, session, data, hash);
|
||||
_shownSession = session;
|
||||
_shown->events() | rpl::start_with_next([=](Controller::Event event) {
|
||||
_shown->events() | rpl::on_next([=](Controller::Event event) {
|
||||
using Type = Controller::Event::Type;
|
||||
const auto lower = event.url.toLower();
|
||||
const auto urlChecked = lower.startsWith("http://")
|
||||
@@ -966,7 +966,7 @@ void Instance::show(
|
||||
|
||||
session->changes().peerUpdates(
|
||||
::Data::PeerUpdate::Flag::ChannelAmIn
|
||||
) | rpl::start_with_next([=](const ::Data::PeerUpdate &update) {
|
||||
) | rpl::on_next([=](const ::Data::PeerUpdate &update) {
|
||||
if (const auto channel = update.peer->asChannel()) {
|
||||
if (channel->amIn()) {
|
||||
const auto i = _joining.find(session);
|
||||
@@ -1092,7 +1092,7 @@ void Instance::showTonSite(
|
||||
return;
|
||||
}
|
||||
_tonSite = std::make_unique<TonSite>(_delegate, uri);
|
||||
_tonSite->events() | rpl::start_with_next([=](Controller::Event event) {
|
||||
_tonSite->events() | rpl::on_next([=](Controller::Event event) {
|
||||
using Type = Controller::Event::Type;
|
||||
const auto lower = event.url.toLower();
|
||||
const auto urlChecked = lower.startsWith("http://")
|
||||
|
||||
Reference in New Issue
Block a user