InsetArgument::InsetArgument(Buffer * buf, string const & name)
- : InsetCollapsable(buf), name_(name), labelstring_(docstring())
+ : InsetCollapsable(buf), name_(name), labelstring_(docstring()),
+ font_(inherit_font), labelfont_(inherit_font), decoration_(string())
{}
support::rsplit(label, striplabel, '|');
labelstring_ = striplabel.empty() ? label: striplabel;
tooltip_ = translateIfPossible((*lait).second.tooltip);
+ font_ = (*lait).second.font;
+ labelfont_ = (*lait).second.labelfont;
+ decoration_ = (*lait).second.decoration;
} else {
labelstring_ = _("Unknown Argument");
tooltip_ = _("Argument not known in this Layout. Will be supressed in the output.");
return "context-argument";
}
+FontInfo InsetArgument::getFont() const
+{
+ if (font_ != inherit_font)
+ return font_;
+ return getLayout().font();
+}
+
+FontInfo InsetArgument::getLabelfont() const
+{
+ if (labelfont_ != inherit_font)
+ return labelfont_;
+ return getLayout().labelfont();
+}
+
+namespace {
+
+InsetLayout::InsetDecoration translateDecoration(std::string const & str)
+{
+ if (support::compare_ascii_no_case(str, "classic") == 0)
+ return InsetLayout::CLASSIC;
+ if (support::compare_ascii_no_case(str, "minimalistic") == 0)
+ return InsetLayout::MINIMALISTIC;
+ if (support::compare_ascii_no_case(str, "conglomerate") == 0)
+ return InsetLayout::CONGLOMERATE;
+ return InsetLayout::DEFAULT;
+}
+
+}// namespace anon
+
+InsetLayout::InsetDecoration InsetArgument::decoration() const
+{
+ InsetLayout::InsetDecoration dec = getLayout().decoration();
+ if (!decoration_.empty())
+ dec = translateDecoration(decoration_);
+ return dec == InsetLayout::DEFAULT ? InsetLayout::CLASSIC : dec;
+}
+
void InsetArgument::latexArgument(otexstream & os,
OutputParams const & runparams_in, docstring const & ldelim,
docstring const & rdelim) const