InsetLayout::InsetLayout() :
name_(from_ascii("undefined")), labelstring_(from_ascii("UNDEFINED")),
+ decoration_(InsetLayout::Default),
font_(sane_font), labelfont_(sane_font), bgcolor_(Color_error),
multipar_(false), passthru_(false), needprotect_(false),
freespacing_(false), keepempty_(false), forceltr_(false)
};
+namespace {
+ InsetLayout::InsetDecoration translateDecoration(std::string const & str)
+ {
+ if (str == "classic")
+ return InsetLayout::Classic;
+ if (str == "minimalistic")
+ return InsetLayout::Minimalistic;
+ if (str == "conglomerate")
+ return InsetLayout::Conglomerate;
+ return InsetLayout::Default;
+ }
+}
+
+
bool InsetLayout::read(Lexer & lexrc)
{
name_ = support::subst(lexrc.getDocString(), '_', ' ');
break;
case IL_DECORATION:
lexrc.next();
- decoration_ = lexrc.getString();
+ decoration_ = translateDecoration(lexrc.getString());
break;
case IL_LATEXNAME:
lexrc.next();
needprotect_ = lexrc.getBool();
break;
case IL_FONT: {
- font = lyxRead(lexrc, inherit_font);
- // So: define font before labelfont
- labelfont_ = font;
+ font_ = lyxRead(lexrc, inherit_font);
+ // If you want to define labelfont, you need to do so after
+ // font is defined.
+ labelfont_ = font_;
break;
}
case IL_BGCOLOR: {