2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +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

@@ -32,6 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/style/style_palette_colorizer.h"
#include "ui/ui_utility.h"
#include "ui/boxes/confirm_box.h"
#include "webview/webview_interface.h"
#include "boxes/background_box.h"
#include "core/application.h"
#include "styles/style_widgets.h"
@@ -1491,7 +1492,7 @@ bool ReadPaletteValues(const QByteArray &content, Fn<bool(QLatin1String name, QL
return true;
}
[[nodiscard]] QByteArray WebViewParams() {
[[nodiscard]] Webview::ThemeParams WebViewParams() {
const auto colors = std::vector<std::pair<QString, const style::color&>>{
{ "bg_color", st::windowBg },
{ "text_color", st::windowFg },
@@ -1514,7 +1515,14 @@ bool ReadPaletteValues(const QByteArray &content, Fn<bool(QLatin1String name, QL
};
object.insert(name, '#' + hex(r) + hex(g) + hex(b));
}
return QJsonDocument(object).toJson(QJsonDocument::Compact);
return {
.scrollBg = st::scrollBg->c,
.scrollBgOver = st::scrollBgOver->c,
.scrollBarBg = st::scrollBarBg->c,
.scrollBarBgOver = st::scrollBarBgOver->c,
.json = QJsonDocument(object).toJson(QJsonDocument::Compact),
};
}
} // namespace Theme