partial fonts fix. Like Juergen said we really need our own dialog.

Not that there's any point until qfont_loader reads  lyxrc...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5663 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-11-17 16:43:36 +00:00
parent 9d23bc01cc
commit 1199867058
2 changed files with 38 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2002-11-17 John Levon <levon@movementarian.org>
* QPrefsDialog.C: partial fonts fix
2002-11-17 John Levon <levon@movementarian.org> 2002-11-17 John Levon <levon@movementarian.org>
* QPrefsDialog.h: * QPrefsDialog.h:

View File

@ -567,53 +567,61 @@ void QPrefsDialog::select_lyxpipe()
pathsModule->lyxserverDirED->setText(file.c_str()); pathsModule->lyxserverDirED->setText(file.c_str());
} }
namespace {
QFont fontFromString(QString const & s) {
QFont f;
#if QT_VERSION >= 300
f.fromString(s);
return f;
#else
f.setRawName(s);
return f;
#endif
}
QString const fontToString(QFont const & f) {
#if QT_VERSION >= 300
return f.toString();
#else
return f.rawName();
#endif
}
}
void QPrefsDialog::change_roman() void QPrefsDialog::change_roman()
{ {
#if QT_VERSION >= 300 QFont f(fontFromString(screenfontsModule->screenRomanED->text()));
QFont f;
f.fromString(screenfontsModule->screenRomanED->text());
// Qt designers hadn't heard of references // Qt designers hadn't heard of references
bool ok; bool ok;
QFontDialog::getFont(&ok, f); f = QFontDialog::getFont(&ok, f);
if (ok) if (ok)
screenfontsModule->screenRomanED->setText(f.toString()); screenfontsModule->screenRomanED->setText(fontToString(f));
#else
// ??
#endif
} }
void QPrefsDialog::change_sans() void QPrefsDialog::change_sans()
{ {
#if QT_VERSION >= 300 QFont f(fontFromString(screenfontsModule->screenSansED->text()));
QFont f;
f.fromString(screenfontsModule->screenSansED->text());
// Qt designers hadn't heard of references // Qt designers hadn't heard of references
bool ok; bool ok;
QFontDialog::getFont(&ok, f); f = QFontDialog::getFont(&ok, f);
if (ok) if (ok)
screenfontsModule->screenSansED->setText(f.toString()); screenfontsModule->screenSansED->setText(fontToString(f));
#else
// ?? rawName is no good
#endif
} }
void QPrefsDialog::change_typewriter() void QPrefsDialog::change_typewriter()
{ {
#if QT_VERSION >= 300 QFont f(fontFromString(screenfontsModule->screenTypewriterED->text()));
QFont f;
f.fromString(screenfontsModule->screenTypewriterED->text());
// Qt designers hadn't heard of references // Qt designers hadn't heard of references
bool ok; bool ok;
QFontDialog::getFont(&ok, f); f = QFontDialog::getFont(&ok, f);
if (ok) if (ok)
screenfontsModule->screenTypewriterED->setText(f.toString()); screenfontsModule->screenTypewriterED->setText(fontToString(f));
#else
// ?? rawName is no good
#endif
} }