1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Revert "Add new option "Ignore system colors" for dark themes."

This reverts commit 4b2fd86fdd.
This commit is contained in:
nowrep 2013-01-31 11:53:48 +01:00
parent 4b2fd86fdd
commit b97d1eeef5
4 changed files with 9 additions and 28 deletions

View File

@ -399,10 +399,8 @@ 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");
@ -836,8 +834,7 @@ void MainApplication::reloadUserStyleSheet()
{
Settings settings;
settings.beginGroup("Web-Browser-Settings");
m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString(),
settings.value("ignoreSystemColors", false).toBool()));
m_websettings->setUserStyleSheetUrl(userStyleSheet(settings.value("userStyleSheet", QString()).toString()));
settings.endGroup();
}
@ -883,18 +880,11 @@ RegisterQAppAssociation* MainApplication::associationManager()
}
#endif
QUrl MainApplication::userStyleSheet(const QString &filePath, bool ignoreSystemColors) const
QUrl MainApplication::userStyleSheet(const QString &filePath) const
{
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;}";
}
// Set default white background for all sites
// Fixes issue with dark themes when sites don't set background
QString userStyle = "html{background-color:white;}";
userStyle += AdBlockManager::instance()->elementHidingRules() + "{ display:none !important;}";
QFile file(filePath);

View File

@ -148,7 +148,7 @@ private:
void translateApp();
void restoreOtherWindows();
QUrl userStyleSheet(const QString &filePath, bool ignoreSystemColors) const;
QUrl userStyleSheet(const QString &filePath) const;
CookieManager* m_cookiemanager;
BrowsingLibrary* m_browsingLibrary;

View File

@ -253,7 +253,6 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt());
ui->defaultZoom->setValue(settings.value("DefaultZoom", 100).toInt());
ui->xssAuditing->setChecked(settings.value("XSSAuditing", false).toBool());
ui->ignoreSystemColors->setChecked(settings.value("ignoreSystemColors", false).toBool());
//Cache
ui->pagesInCache->setValue(settings.value("maximumCachedPages", 3).toInt());
@ -899,7 +898,6 @@ void Preferences::saveSettings()
settings.setValue("LoadTabsOnActivation", ui->dontLoadTabsUntilSelected->isChecked());
settings.setValue("DefaultZoom", ui->defaultZoom->value());
settings.setValue("XSSAuditing", ui->xssAuditing->isChecked());
settings.setValue("ignoreSystemColors", ui->ignoreSystemColors->isChecked());
#ifdef Q_OS_WIN
settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked());
#endif

View File

@ -596,11 +596,11 @@
<item row="9" column="0" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>&lt;b&gt;Colors&lt;b/&gt;</string>
<string>&lt;b&gt;Background&lt;b/&gt;</string>
</property>
</widget>
</item>
<item row="12" column="1">
<item row="11" column="1">
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -641,13 +641,6 @@
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="ignoreSystemColors">
<property name="text">
<string>Ignore system colors (for dark themes)</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>