From 491b66a6b70056790f2605da28851384b056b06c Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Thu, 13 Jun 2024 08:16:06 +0200 Subject: [PATCH] SiteInfo: Immediately apply "Farce Dark Mode" Signed-off-by: Juraj Oravec --- src/lib/other/siteinfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/other/siteinfo.cpp b/src/lib/other/siteinfo.cpp index 97fc1946c..8111658d5 100644 --- a/src/lib/other/siteinfo.cpp +++ b/src/lib/other/siteinfo.cpp @@ -381,5 +381,12 @@ void SiteInfo::saveSiteSettings() if (!(siteSettings == mApp->siteSettingsManager()->getSiteSettings(m_baseUrl))) { mApp->siteSettingsManager()->setSiteSettings(siteSettings); + +#if QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(6, 7, 0) + m_view->page()->settings()->setAttribute( + QWebEngineSettings::ForceDarkMode, + siteSettings.attributes[QWebEngineSettings::ForceDarkMode] + ); +#endif } }