From d617273e6a974dbeb31d386d448ecdbe6cb7e8a9 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 26 Mar 2022 11:06:46 +0100 Subject: [PATCH] integrate font config, sync scrollbar pos --- .../gui/litehtml/litehtmlviewer.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/librssguard/gui/litehtml/litehtmlviewer.cpp b/src/librssguard/gui/litehtml/litehtmlviewer.cpp index 5e841be0f..24a823f86 100755 --- a/src/librssguard/gui/litehtml/litehtmlviewer.cpp +++ b/src/librssguard/gui/litehtml/litehtmlviewer.cpp @@ -12,6 +12,7 @@ #include "network-web/webfactory.h" #include +#include #include LiteHtmlViewer::LiteHtmlViewer(QWidget* parent) : QLiteHtmlWidget(parent) { @@ -90,14 +91,16 @@ void LiteHtmlViewer::setHtml(const QString& html, const QUrl& base_url) { } QString LiteHtmlViewer::html() const { - return {}; + return QLiteHtmlWidget::html(); } QUrl LiteHtmlViewer::url() const { - return {}; + return QLiteHtmlWidget::url(); } -void LiteHtmlViewer::clear() {} +void LiteHtmlViewer::clear() { + setHtml({}); +} void LiteHtmlViewer::loadMessages(const QList& messages, RootItem* root) { Skin skin = qApp->skins()->currentSkin(); @@ -175,12 +178,16 @@ void LiteHtmlViewer::loadMessages(const QList& messages, RootItem* root } double LiteHtmlViewer::verticalScrollBarPosition() const { - return {}; + return verticalScrollBar()->value(); } -void LiteHtmlViewer::setVerticalScrollBarPosition(double pos) {} +void LiteHtmlViewer::setVerticalScrollBarPosition(double pos) { + verticalScrollBar()->setValue(pos); +} -void LiteHtmlViewer::reloadFontSettings(const QFont& fon) {} +void LiteHtmlViewer::reloadFontSettings(const QFont& fon) { + QLiteHtmlWidget::setDefaultFont(fon); +} bool LiteHtmlViewer::canZoomIn() const { return zoomFactor() <= double(MAX_ZOOM_FACTOR) - double(ZOOM_FACTOR_STEP);