From ffc1afc30dc4343a3b1630c6b4ebd25570ac8d2d Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Mon, 7 Jun 2010 07:57:56 +0000 Subject: Theme Editor: Added font selection git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26650 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/skindocument.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'utils/themeeditor/skindocument.cpp') diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp index fbb33cc..730d03a 100644 --- a/utils/themeeditor/skindocument.cpp +++ b/utils/themeeditor/skindocument.cpp @@ -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(); + family.setPointSize(settings.value("fontSize", 12).toInt()); + editor->setFont(family); + editor->repaint(); settings.endGroup(); -- cgit v1.1