1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Added a preferences dialog and allowed modification of the syntax highlighting and editor colors

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26640 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-07 03:25:40 +00:00
parent fbfdaf5c79
commit 53b619c6e8
10 changed files with 563 additions and 23 deletions

View file

@ -21,13 +21,12 @@
#include "skinhighlighter.h"
SkinHighlighter::SkinHighlighter(QColor comment, QColor tag, QColor conditional,
QColor escaped, QTextDocument* doc)
:QSyntaxHighlighter(doc),
escaped(escaped), tag(tag),
conditional(conditional), comment(comment)
{
#include <QSettings>
SkinHighlighter::SkinHighlighter(QTextDocument* doc)
:QSyntaxHighlighter(doc)
{
loadSettings();
}
SkinHighlighter::~SkinHighlighter()
@ -151,3 +150,23 @@ void SkinHighlighter::highlightBlock(const QString& text)
}
}
}
void SkinHighlighter::loadSettings()
{
QSettings settings;
settings.beginGroup("SkinHighlighter");
/* Loading the highlighting colors */
tag = settings.value("tagColor", QColor(180,0,0)).value<QColor>();
conditional = settings.value("conditionalColor",
QColor(0, 0, 180)).value<QColor>();
escaped = settings.value("escapedColor",
QColor(120,120,120)).value<QColor>();
comment = settings.value("commentColor",
QColor(0, 180, 0)).value<QColor>();
settings.endGroup();
rehighlight();
}