2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Support theming for webview-s (payments, attach).

This commit is contained in:
John Preston
2022-03-29 00:14:10 +04:00
parent df15ff9f8e
commit aed1904b4c
14 changed files with 147 additions and 31 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "apiwrap.h"
#include "api/api_cloud_password.h"
#include "window/themes/window_theme.h"
#include <QJsonDocument>
#include <QJsonObject>
@@ -161,6 +162,17 @@ CheckoutProcess::CheckoutProcess(
showForm();
_panel->toggleProgress(true);
style::PaletteChanged(
) | rpl::filter([=] {
return !_themeUpdateScheduled;
}) | rpl::start_with_next([=] {
_themeUpdateScheduled = true;
crl::on_main(this, [=] {
_themeUpdateScheduled = false;
_panel->updateThemeParams(Window::Theme::WebViewParams());
});
}, _panel->lifetime());
if (mode == Mode::Payment) {
_session->api().cloudPassword().state(
) | rpl::start_with_next([=](const Core::CloudPasswordState &state) {