1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Added font selection

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26650 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-07 07:57:56 +00:00
parent 4a9398e3fc
commit ffc1afc30d
5 changed files with 173 additions and 87 deletions

View file

@ -65,7 +65,7 @@ SkinDocument::~SkinDocument()
void SkinDocument::connectPrefs(PreferencesDialog* prefs)
{
QObject::connect(prefs, SIGNAL(accepted()),
this, SLOT(colorsChanged()));
this, SLOT(settingsChanged()));
QObject::connect(prefs, SIGNAL(accepted()),
highlighter, SLOT(loadSettings()));
}
@ -124,10 +124,10 @@ void SkinDocument::setupUI()
QObject::connect(editor, SIGNAL(textChanged()),
this, SLOT(codeChanged()));
colorsChanged();
settingsChanged();
}
void SkinDocument::colorsChanged()
void SkinDocument::settingsChanged()
{
/* Setting the editor colors */
QSettings settings;
@ -140,6 +140,12 @@ void SkinDocument::colorsChanged()
palette.setColor(QPalette::All, QPalette::Text, fg);
editor->setPalette(palette);
/* Setting the font */
QFont family = settings.value("fontFamily", QFont()).value<QFont>();
family.setPointSize(settings.value("fontSize", 12).toInt());
editor->setFont(family);
editor->repaint();
settings.endGroup();