mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Custom scroll bar in WebKit / Chromium.
This commit is contained in:
@@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "apiwrap.h"
|
||||
#include "api/api_cloud_password.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "webview/webview_interface.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
@@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "apiwrap.h"
|
||||
#include "core/core_cloud_password.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "webview/webview_interface.h"
|
||||
#include "styles/style_payments.h" // paymentsThumbnailSize.
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
@@ -242,7 +243,7 @@ void Form::requestForm() {
|
||||
MTP_flags(MTPpayments_GetPaymentForm::Flag::f_theme_params),
|
||||
_peer->input,
|
||||
MTP_int(_msgId),
|
||||
MTP_dataJSON(MTP_bytes(Window::Theme::WebViewParams()))
|
||||
MTP_dataJSON(MTP_bytes(Window::Theme::WebViewParams().json))
|
||||
)).done([=](const MTPpayments_PaymentForm &result) {
|
||||
hideProgress();
|
||||
result.match([&](const auto &data) {
|
||||
|
@@ -783,15 +783,20 @@ void Panel::showWebviewError(
|
||||
showCriticalError(rich);
|
||||
}
|
||||
|
||||
void Panel::updateThemeParams(const QByteArray &json) {
|
||||
void Panel::updateThemeParams(const Webview::ThemeParams ¶ms) {
|
||||
if (!_webview || !_webview->window.widget()) {
|
||||
return;
|
||||
}
|
||||
_webview->window.updateTheme(
|
||||
params.scrollBg,
|
||||
params.scrollBgOver,
|
||||
params.scrollBarBg,
|
||||
params.scrollBarBgOver);
|
||||
_webview->window.eval(R"(
|
||||
if (window.TelegramGameProxy) {
|
||||
window.TelegramGameProxy.receiveEvent(
|
||||
"theme_changed",
|
||||
{ "theme_params": )" + json + R"( });
|
||||
{ "theme_params": )" + params.json + R"( });
|
||||
}
|
||||
)");
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ class Checkbox;
|
||||
|
||||
namespace Webview {
|
||||
struct Available;
|
||||
struct ThemeParams;
|
||||
} // namespace Webview
|
||||
|
||||
namespace Payments::Ui {
|
||||
@@ -76,7 +77,7 @@ public:
|
||||
const QString &url,
|
||||
bool allowBack,
|
||||
rpl::producer<QString> bottomText);
|
||||
void updateThemeParams(const QByteArray &json);
|
||||
void updateThemeParams(const Webview::ThemeParams ¶ms);
|
||||
|
||||
[[nodiscard]] rpl::producer<> backRequests() const;
|
||||
|
||||
|
Reference in New Issue
Block a user