22 #include <QStringList>
27 QColor CtrlFGColor, QColor CtrlBGColor,
31 QColor LnNumFGColor, QColor LnNumBGColor,
33 QColor KeyWdFGColor, QFont::Weight KeyWdWeight,
35 QColor ClsFGColor, QFont::Weight ClsWeight,
37 QColor QteFGColor, QFont::Weight QteWeight,
39 QColor CmtFGColor, QFont::Weight CmtWeight,
41 QColor SymbFGColor, QColor SymbBGColor,
43 QFont::Weight SymbWeight) :
44 widgetFGColor(CtrlFGColor),
45 widgetBGColor(CtrlBGColor),
46 highlightBGColor(HiLiBGColor),
47 lineNumFGColor(LnNumFGColor),
48 lineNumBGColor(LnNumBGColor),
49 keywordColor(KeyWdFGColor),
50 keywordWeight(KeyWdWeight),
51 classColor(ClsFGColor),
52 classWeight(ClsWeight),
53 quoteColor(QteFGColor),
54 quoteWeight(QteWeight),
55 commentColor(CmtFGColor),
56 commentWeight(CmtWeight),
57 symbolFGColor(SymbFGColor),
58 symbolBGColor(SymbBGColor),
59 symbolWeight(SymbWeight)
86 return !(*
this == rhs);
107 QString type = settings->value(
112 settings->endGroup();
117 settings->endGroup();
170 settings->endGroup();
189 if (isDefaultLight && !isDefaultDark) {
192 }
else if (!isDefaultLight && isDefaultDark) {
231 settings->endGroup();
static void saveSettings(QSettings *settings, const CodeEditorStyle &theStyle)
QFont::Weight classWeight
QFont::Weight commentWeight
static CodeEditorStyle getSystemTheme()
QFont::Weight quoteWeight
static CodeEditorStyle loadSettings(QSettings *settings)
QFont::Weight symbolWeight
bool isSystemTheme() const
bool operator==(const CodeEditorStyle &rhs) const
bool operator!=(const CodeEditorStyle &rhs) const
CodeEditorStyle(QColor CtrlFGColor, QColor CtrlBGColor, QColor HiLiBGColor, QColor LnNumFGColor, QColor LnNumBGColor, QColor KeyWdFGColor, QFont::Weight KeyWdWeight, QColor ClsFGColor, QFont::Weight ClsWeight, QColor QteFGColor, QFont::Weight QteWeight, QColor CmtFGColor, QFont::Weight CmtWeight, QColor SymbFGColor, QColor SymbBGColor, QFont::Weight SymbWeight)
QFont::Weight keywordWeight
const QString SETTINGS_STYLE_SYMBOLFG("StyleSymbolFG")
const QString SETTINGS_STYLE_GROUP("EditorStyle")
const QString SETTINGS_STYLE_QUOTEFG("StyleQuoteFG")
const QString SETTINGS_STYLE_KEYWORDFG("StyleKeywordFG")
const QString SETTINGS_STYLE_TYPE_CUSTOM("Custom")
const QString SETTINGS_STYLE_LINENUMFG("StyleLineNumFG")
const QString SETTINGS_STYLE_QUOTEWT("StyleQuoteWeight")
const QString SETTINGS_STYLE_KEYWORDWT("StyleKeywordWeight")
const QString SETTINGS_STYLE_TYPE("StyleType")
const QString SETTINGS_STYLE_TYPE_DARK("DefaultDark")
const QString SETTINGS_STYLE_SYMBOLWT("StyleSymbolWeight")
const QString SETTINGS_STYLE_HILIFG("StyleHighlightFG")
const QString SETTINGS_STYLE_LINENUMBG("StyleLineNumBG")
const QString SETTINGS_STYLE_TYPE_LIGHT("DefaultLight")
const QString SETTINGS_STYLE_SYMBOLBG("StyleSymbolBG")
static const CodeEditorStyle defaultStyleLight(Qt::black, QColor(240, 240, 240), QColor(255, 220, 220), Qt::black, QColor(240, 240, 240), Qt::darkBlue, QFont::Bold, Qt::darkMagenta, QFont::Bold, Qt::darkGreen, QFont::Normal, Qt::gray, QFont::Normal, Qt::red, QColor(220, 220, 255), QFont::Normal)
const QString SETTINGS_STYLE_WIDGETBG("StyleWidgetBG")
const QString SETTINGS_STYLE_CLASSWT("StyleClassWeight")
const QString SETTINGS_STYLE_CLASSFG("StyleClassFG")
const QString SETTINGS_STYLE_COMMENTFG("StyleCommentFG")
const QString SETTINGS_STYLE_WIDGETFG("StyleWidgetFG")
const QString SETTINGS_STYLE_COMMENTWT("StyleCommentWeight")
static const CodeEditorStyle defaultStyleDark(QColor(218, 218, 218), QColor(16, 16, 32), QColor(64, 64, 64), QColor(43, 145, 175), QColor(16, 16, 32), QColor(0, 204, 204), QFont::Bold, QColor(218, 0, 218), QFont::Bold, QColor(0, 204, 0), QFont::Normal, QColor(180, 180, 180), QFont::Normal, QColor(218, 32, 32), QColor(32, 32, 108), QFont::Normal)