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:
parent
4a9398e3fc
commit
ffc1afc30d
5 changed files with 173 additions and 87 deletions
|
@ -42,6 +42,7 @@ PreferencesDialog::~PreferencesDialog()
|
|||
void PreferencesDialog::loadSettings()
|
||||
{
|
||||
loadColors();
|
||||
loadFont();
|
||||
}
|
||||
|
||||
void PreferencesDialog::loadColors()
|
||||
|
@ -83,9 +84,25 @@ void PreferencesDialog::loadColors()
|
|||
settings.endGroup();
|
||||
}
|
||||
|
||||
void PreferencesDialog::loadFont()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup("SkinDocument");
|
||||
|
||||
QVariant family = settings.value("fontFamily", QFont());
|
||||
int size = settings.value("fontSize", 12).toInt();
|
||||
|
||||
settings.endGroup();
|
||||
|
||||
ui->fontSelect->setCurrentFont(family.value<QFont>());
|
||||
ui->fontSize->setValue(size);
|
||||
|
||||
}
|
||||
|
||||
void PreferencesDialog::saveSettings()
|
||||
{
|
||||
saveColors();
|
||||
saveFont();
|
||||
}
|
||||
|
||||
void PreferencesDialog::saveColors()
|
||||
|
@ -111,6 +128,17 @@ void PreferencesDialog::saveColors()
|
|||
settings.endGroup();
|
||||
}
|
||||
|
||||
void PreferencesDialog::saveFont()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.beginGroup("SkinDocument");
|
||||
|
||||
settings.setValue("fontFamily", ui->fontSelect->currentFont());
|
||||
settings.setValue("fontSize", ui->fontSize->value());
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
void PreferencesDialog::setupUI()
|
||||
{
|
||||
/* Connecting color buttons */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue