mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
SiteInfo: Fix ForceDarkMode update after a change
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
7816ea95b7
commit
9da1243ca6
@ -379,14 +379,26 @@ void SiteInfo::saveSiteSettings()
|
|||||||
|
|
||||||
siteSettings.server = m_baseUrl.host();
|
siteSettings.server = m_baseUrl.host();
|
||||||
|
|
||||||
if (!(siteSettings == mApp->siteSettingsManager()->getSiteSettings(m_baseUrl))) {
|
auto storedSiteSettings = mApp->siteSettingsManager()->getSiteSettings(m_baseUrl);
|
||||||
|
|
||||||
|
if (!(siteSettings == storedSiteSettings)) {
|
||||||
mApp->siteSettingsManager()->setSiteSettings(siteSettings);
|
mApp->siteSettingsManager()->setSiteSettings(siteSettings);
|
||||||
|
|
||||||
#if QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
#if QTWEBENGINECORE_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||||
m_view->page()->settings()->setAttribute(
|
if (siteSettings.attributes[QWebEngineSettings::ForceDarkMode] != storedSiteSettings.attributes[QWebEngineSettings::ForceDarkMode]) {
|
||||||
QWebEngineSettings::ForceDarkMode,
|
bool enableForceDarkMode = false;
|
||||||
siteSettings.attributes[QWebEngineSettings::ForceDarkMode]
|
|
||||||
);
|
if (siteSettings.attributes[QWebEngineSettings::ForceDarkMode] == SiteSettingsManager::Default) {
|
||||||
|
enableForceDarkMode = mApp->siteSettingsManager()->getDefaultPermission(QWebEngineSettings::ForceDarkMode) == SiteSettingsManager::Allow;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
enableForceDarkMode = siteSettings.attributes[QWebEngineSettings::ForceDarkMode] == SiteSettingsManager::Allow;
|
||||||
|
}
|
||||||
|
m_view->page()->settings()->setAttribute(
|
||||||
|
QWebEngineSettings::ForceDarkMode,
|
||||||
|
enableForceDarkMode
|
||||||
|
);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user