From a7d719fbac285423ada14ffae213622a135a26f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 10 Apr 2009 14:39:22 +0000 Subject: [PATCH] * GuiDocument.cpp: - minor xetex UI tweaks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29188 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 42 ++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 104df745f7..917a4fb102 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1174,10 +1174,26 @@ void GuiDocument::xetexChanged(bool xetex) !langModule->defaultencodingRB->isChecked()); langModule->defaultencodingRB->setEnabled(!xetex); langModule->otherencodingRB->setEnabled(!xetex); - + fontModule->fontsDefaultCO->setEnabled(!xetex); - if (xetex) - fontModule->fontScCB->setEnabled(false); + fontModule->fontsDefaultLA->setEnabled(!xetex); + fontModule->cjkFontLE->setEnabled(!xetex); + fontModule->cjkFontLA->setEnabled(!xetex); + string font; + if (!xetex) + font = tex_fonts_sans[fontModule->fontsSansCO->currentIndex()]; + bool scaleable = providesScale(font); + fontModule->scaleSansSB->setEnabled(scaleable); + fontModule->scaleSansLA->setEnabled(scaleable); + if (!xetex) + font = tex_fonts_monospaced[fontModule->fontsTypewriterCO->currentIndex()]; + scaleable = providesScale(font); + fontModule->scaleTypewriterSB->setEnabled(scaleable); + fontModule->scaleTypewriterLA->setEnabled(scaleable); + if (!xetex) + font = tex_fonts_roman[fontModule->fontsRomanCO->currentIndex()]; + fontModule->fontScCB->setEnabled(providesSC(font)); + fontModule->fontOsfCB->setEnabled(providesOSF(font)); } @@ -1244,10 +1260,8 @@ void GuiDocument::updateFontlist() void GuiDocument::romanChanged(int item) { - if (outputModule->xetexCB->isChecked()) { - fontModule->fontScCB->setEnabled(false); + if (outputModule->xetexCB->isChecked()) return; - } string const font = tex_fonts_roman[item]; fontModule->fontScCB->setEnabled(providesSC(font)); fontModule->fontOsfCB->setEnabled(providesOSF(font)); @@ -1256,10 +1270,8 @@ void GuiDocument::romanChanged(int item) void GuiDocument::sansChanged(int item) { - if (outputModule->xetexCB->isChecked()) { - fontModule->fontScCB->setEnabled(false); + if (outputModule->xetexCB->isChecked()) return; - } string const font = tex_fonts_sans[item]; bool scaleable = providesScale(font); fontModule->scaleSansSB->setEnabled(scaleable); @@ -1269,10 +1281,8 @@ void GuiDocument::sansChanged(int item) void GuiDocument::ttChanged(int item) { - if (outputModule->xetexCB->isChecked()) { - fontModule->fontScCB->setEnabled(false); + if (outputModule->xetexCB->isChecked()) return; - } string const font = tex_fonts_monospaced[item]; bool scaleable = providesScale(font); fontModule->scaleTypewriterSB->setEnabled(scaleable); @@ -2605,6 +2615,10 @@ bool GuiDocument::isFontAvailable(string const & font) const bool GuiDocument::providesOSF(string const & font) const { + if (outputModule->xetexCB->isChecked()) + // FIXME: we should check if the fonts really + // have OSF support. But how? + return true; if (font == "cmr") return isFontAvailable("eco"); if (font == "palatino") @@ -2615,6 +2629,8 @@ bool GuiDocument::providesOSF(string const & font) const bool GuiDocument::providesSC(string const & font) const { + if (outputModule->xetexCB->isChecked()) + return false; if (font == "palatino") return isFontAvailable("mathpazo"); if (font == "utopia") @@ -2625,6 +2641,8 @@ bool GuiDocument::providesSC(string const & font) const bool GuiDocument::providesScale(string const & font) const { + if (outputModule->xetexCB->isChecked()) + return true; return font == "helvet" || font == "luximono" || font == "berasans" || font == "beramono"; } -- 2.39.2