GUI: Revert my theme changes. The theme selection will only be for the code editor again.

This commit is contained in:
Daniel Marjamäki 2019-08-18 21:11:46 +02:00
parent 474fed453e
commit 5d021cb41d
6 changed files with 4 additions and 40 deletions

View File

@ -219,18 +219,3 @@ void CodeEditorStyle::saveSettings(QSettings *settings,
}
settings->endGroup();
}
static QString rgbStyleString(QColor c)
{
return QString("rgb(%1,%2,%3)").arg(c.red()).arg(c.green()).arg(c.blue());
}
QString CodeEditorStyle::generateStyleString() const
{
if (isSystemTheme())
return QString();
return QString("background:%1; color:%2; selection-background-color:%3;")
.arg(rgbStyleString(widgetBGColor))
.arg(rgbStyleString(widgetFGColor))
.arg(rgbStyleString(highlightBGColor));
}

View File

@ -72,8 +72,6 @@ public:
static CodeEditorStyle loadSettings(QSettings *settings);
static void saveSettings(QSettings *settings, const CodeEditorStyle& theStyle);
QString generateStyleString() const;
public:
bool mSystemTheme;
QColor widgetFGColor;

View File

@ -33,7 +33,6 @@
#include "applicationlist.h"
#include "aboutdialog.h"
#include "codeeditorstyle.h"
#include "common.h"
#include "threadhandler.h"
#include "fileviewdialog.h"
@ -155,8 +154,6 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
loadSettings();
updateStyleSetting();
mThread->initialize(mUI.mResults);
if (mProjectFile)
formatAndSetTitle(tr("Project:") + ' ' + mProjectFile->getFilename());
@ -402,16 +399,6 @@ void MainWindow::saveSettings() const
mUI.mResults->saveSettings(mSettings);
}
void MainWindow::updateStyleSetting()
{
mUI.mResults->updateStyleSetting(mSettings);
QString styleSheet = CodeEditorStyle::loadSettings(mSettings).generateStyleString();
mUI.mToolBarMain->setStyleSheet(styleSheet);
mUI.mToolBarView->setStyleSheet(styleSheet);
mUI.mToolBarFilter->setStyleSheet(styleSheet);
this->setStyleSheet(styleSheet);
}
void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, const bool checkConfiguration)
{
clearResults();
@ -1027,7 +1014,7 @@ void MainWindow::programSettings()
dialog.showNoErrorsMessage(),
dialog.showErrorId(),
dialog.showInconclusive());
this->updateStyleSetting();
mUI.mResults->updateStyleSetting(mSettings);
const QString newLang = mSettings->value(SETTINGS_LANGUAGE, "en").toString();
setLanguage(newLang);
}

View File

@ -227,9 +227,6 @@ protected slots:
private:
/** Set widget themes */
void updateStyleSetting();
/** Get filename for last results */
QString getLastResults() const;

View File

@ -244,9 +244,6 @@ void ResultsView::updateStyleSetting(QSettings *settings)
{
CodeEditorStyle theStyle(CodeEditorStyle::loadSettings(settings));
mUI.mCode->setStyle(theStyle);
QString styleString(theStyle.generateStyleString());
mUI.mTree->setStyleSheet(styleString);
mUI.mDetails->setStyleSheet(styleString);
}
void ResultsView::setCheckDirectory(const QString &dir)

View File

@ -420,15 +420,15 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mTabTheme">
<widget class="QWidget" name="mTabEditorStyle">
<attribute name="title">
<string>Theme</string>
<string>Code Editor</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QGroupBox" name="gboxEditorStyle">
<property name="title">
<string>Style</string>
<string>Code Editor Style</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>