|
|
|
|
@ -399,8 +399,10 @@ void MainApplication::loadSettings() |
|
|
|
|
m_websettings->setAttribute(QWebSettings::JavascriptCanCloseWindows, settings.value("allowJavaScriptCloseWindow", false).toBool()); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
const QUrl &styleSheet = userStyleSheet(settings.value("userStyleSheet", QString()).toString(), |
|
|
|
|
settings.value("ignoreSystemColors", false).toBool()); |
|
|
|
|
m_websettings->setUserStyleSheetUrl(styleSheet); |
|
|
|
|
setWheelScrollLines(settings.value("wheelScrollLines", wheelScrollLines()).toInt()); |
|
|
|
|
m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString())); |
|
|
|
|
settings.endGroup(); |
|
|
|
|
|
|
|
|
|
settings.beginGroup("Browser-Fonts"); |
|
|
|
|
@ -834,7 +836,8 @@ void MainApplication::reloadUserStyleSheet() |
|
|
|
|
{ |
|
|
|
|
Settings settings; |
|
|
|
|
settings.beginGroup("Web-Browser-Settings"); |
|
|
|
|
m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString())); |
|
|
|
|
m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString(), |
|
|
|
|
settings.value("ignoreSystemColors", false).toBool())); |
|
|
|
|
settings.endGroup(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -880,11 +883,18 @@ RegisterQAppAssociation* MainApplication::associationManager() |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
QUrl MainApplication::userStyleSheet(const QString &filePath) const |
|
|
|
|
QUrl MainApplication::userStyleSheet(const QString &filePath, bool ignoreSystemColors) const |
|
|
|
|
{ |
|
|
|
|
// Set default white background for all sites
|
|
|
|
|
// Fixes issue with dark themes when sites don't set background
|
|
|
|
|
QString userStyle = "html{background-color:white;}"; |
|
|
|
|
QString userStyle; |
|
|
|
|
|
|
|
|
|
if (ignoreSystemColors) { |
|
|
|
|
// Set default white background for all sites
|
|
|
|
|
// Fixes issue with dark themes when sites don't set background
|
|
|
|
|
// But it also brings issues with background of iframes that assumes
|
|
|
|
|
// background will by default will be transparent
|
|
|
|
|
userStyle += "html{background-color:white;}"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
userStyle += AdBlockManager::instance()->elementHidingRules() + "{ display:none !important;}"; |
|
|
|
|
|
|
|
|
|
QFile file(filePath); |
|
|
|
|
|