2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Custom scroll bar in WebKit / Chromium.

This commit is contained in:
John Preston
2022-04-12 19:48:32 +04:00
parent 9510d38929
commit d4cb56a73d
10 changed files with 52 additions and 20 deletions

View File

@@ -783,15 +783,20 @@ void Panel::showWebviewError(
showCriticalError(rich);
}
void Panel::updateThemeParams(const QByteArray &json) {
void Panel::updateThemeParams(const Webview::ThemeParams &params) {
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"( });
}
)");
}