From: Enrico Forestieri Date: Fri, 25 Mar 2011 05:01:06 +0000 (+0000) Subject: Preferences for choosing the icon set to use. It works on the fly, but X-Git-Tag: 2.0.0~425 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c6564028f0cb4e358ca13aa41cb409bf9552a5b6;p=lyx.git Preferences for choosing the icon set to use. It works on the fly, but the size of icons may be wrong when switching between sets with different normal icon size. One needs to save the preferences, restart LyX and choose "Normal-sized icons" from the toolbar menu to have the real normal size. A minor glitch is that the name of the icon sets is translatable, but currently only the translation for "Default" works. The problem is that I don't know how to ask gettext for an inverse translation when saving the preferences. Another possibility would be hardcoding the order of the names in the combo box (such that to not rely on their names), but that is ugly and prone to errors if/when other sets are added. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38041 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index b0205a3fa2..215b9a606f 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -1736,7 +1736,6 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c << "#\n\n"; case RC_ICON_SET: - os << "\\icon_set \"" << icon_set << "\"\n"; if (ignore_system_lyxrc || icon_set != system_lyxrc.icon_set) { os << "\\icon_set \"" << icon_set @@ -2936,6 +2935,9 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new) case LyXRC::RC_GROUP_LAYOUTS: case LyXRC::RC_HUNSPELLDIR_PATH: case LyXRC::RC_ICON_SET: + if (lyxrc_orig.icon_set != lyxrc_new.icon_set) { + lyxrc.icon_set = lyxrc_new.icon_set; + } case LyXRC::RC_INDEX_ALTERNATIVES: case LyXRC::RC_INDEX_COMMAND: case LyXRC::RC_JBIBTEX_COMMAND: diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 61224ec7c2..e65ca84a7f 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1193,6 +1193,7 @@ PrefDisplay::PrefDisplay(GuiPreferences * form) connect(displayGraphicsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); connect(instantPreviewCO, SIGNAL(activated(int)), this, SIGNAL(changed())); connect(previewSizeSB, SIGNAL(valueChanged(double)), this, SIGNAL(changed())); + connect(iconSetCO, SIGNAL(activated(int)), this, SIGNAL(changed())); connect(paragraphMarkerCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); } @@ -1224,6 +1225,15 @@ void PrefDisplay::apply(LyXRC & rc) const break; } + switch (iconSetCO->currentIndex()) { + case 0: + rc.icon_set.clear(); + break; + default: + rc.icon_set = fromqstr(iconSetCO->currentText().toLower()); + break; + } + rc.display_graphics = displayGraphicsCB->isChecked(); rc.preview_scale_factor = previewSizeSB->value(); rc.paragraph_markers = paragraphMarkerCB->isChecked(); @@ -1252,6 +1262,13 @@ void PrefDisplay::update(LyXRC const & rc) break; } + string name = rc.icon_set.empty() ? "default" : rc.icon_set; + name[0] = uppercase(name[0]); + int iconset = iconSetCO->findText(qt_(name)); + if (iconset < 0) + iconset = 0; + iconSetCO->setCurrentIndex(iconset); + displayGraphicsCB->setChecked(rc.display_graphics); instantPreviewCO->setEnabled(rc.display_graphics); previewSizeSB->setValue(rc.preview_scale_factor); diff --git a/src/frontends/qt4/ui/PrefDisplayUi.ui b/src/frontends/qt4/ui/PrefDisplayUi.ui index 1a813930ba..97425a9270 100644 --- a/src/frontends/qt4/ui/PrefDisplayUi.ui +++ b/src/frontends/qt4/ui/PrefDisplayUi.ui @@ -108,7 +108,41 @@ - + + + + Icon &Set: + + + iconSetCO + + + + + + + The icon set to use. Warning: size of icons may be wrong +until you save the preferences, restart LyX and choose +"Normal-sized icons" from the toolbar menu. + + + + Default + + + + + Liber + + + + + Oxygen + + + + + Mark end of paragraphs on screen with a pilcrow character. @@ -118,7 +152,7 @@ - + Qt::Vertical