notefontcolor = lyx::rgbFromHexName(color);
lcolor.setColor("notefontcolor", color);
lcolor.setLaTeXName("notefontcolor", "note_fontcolor");
+ lcolor.setGUIName("notefontcolor", N_("greyedout inset text"));
// set a local name for the painter
lcolor.setColor("notefontcolor@" + filename.absFileName(), color);
isnotefontcolor = true;
{
string const lcname = ascii_lowercase(lyxname);
if (lyxcolors.find(lcname) == lyxcolors.end()) {
- LYXERR(Debug::GUI, "ColorSet::setColor: Unknown color \""
+ LYXERR(Debug::GUI, "ColorSet::setLaTeXName: Unknown color \""
<< lyxname << '"');
addColor(static_cast<ColorCode>(infotab.size()), lcname);
}
}
+bool ColorSet::setGUIName(string const & lyxname, string const & guiname)
+{
+ string const lcname = ascii_lowercase(lyxname);
+ if (lyxcolors.find(lcname) == lyxcolors.end()) {
+ LYXERR(Debug::GUI, "ColorSet::setGUIName: Unknown color \""
+ << lyxname << '"');
+ return false;
+ }
+
+ ColorCode col = lyxcolors[lcname];
+ InfoTab::iterator it = infotab.find(col);
+ if (it == infotab.end()) {
+ LYXERR0("Color " << col << " not found in database.");
+ return false;
+ }
+
+ // "inherit" is returned for colors not in the database
+ // (and anyway should not be redefined)
+ if (col == Color_none || col == Color_inherit || col == Color_ignore) {
+ LYXERR0("Color " << getLyXName(col) << " may not be redefined.");
+ return false;
+ }
+
+ if (!guiname.empty())
+ it->second.guiname = guiname;
+ return true;
+}
+
+
void ColorSet::addColor(ColorCode c, string const & lyxname)
{
ColorEntry ce = { c, "", "", "", "", lyxname.c_str() };
*/
bool setLaTeXName(std::string const & lyxname, std::string const & latexname);
+ /** set the GUI name of a given LyX color to a guiname if not yet defined
+ * \returns true if successful.
+ */
+ bool setGUIName(std::string const & lyxname, std::string const & guiname);
+
/// Get the GUI name of \c color.
docstring const getGUIName(ColorCode c) const;
bp_.isfontcolor = is_fontcolor;
bp_.notefontcolor = set_notefontcolor;
bp_.isnotefontcolor = is_notefontcolor;
+ if (is_notefontcolor) {
+ // Set information used in statusbar (#12130)
+ lcolor.setColor("notefontcolor", lyx::X11hexname(set_notefontcolor));
+ lcolor.setGUIName("notefontcolor", N_("greyedout inset text"));
+ }
bp_.boxbgcolor = set_boxbgcolor;
bp_.isboxbgcolor = is_boxbgcolor;