Properly initialize label font.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21378 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-11-02 16:34:37 +00:00
parent 501fa2b3a9
commit b931f6ab4a

View File

@ -84,6 +84,12 @@ InsetCollapsable::InsetCollapsable
setButtonLabel();
// Fallback for lacking inset layout item
layout_.bgcolor = Color_background;
// FIXME: it seems some insets don't properly initialise that!
layout_.labelfont = sane_font;
layout_.labelfont.decSize();
layout_.labelfont.decSize();
layout_.labelfont.setColor(Color_collapsable);
}
@ -227,7 +233,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
dim.des = max(dim.des - textdim.asc + dim.asc, textdim.des);
dim.asc = textdim.asc;
} else {
dim.des += textdim.height() + TEXT_TO_BOTTOM_OFFSET;
dim.des += textdim.height() + TEXT_TO_INSET_OFFSET;
dim.wid = max(dim.wid, textdim.wid);
}
}
@ -764,6 +770,13 @@ void InsetCollapsable::setLabelFont(FontInfo const & font)
layout_.labelfont = font;
}
void InsetCollapsable::setLabelColor(ColorCode code)
{
layout_.labelfont.setColor(code);
}
docstring InsetCollapsable::floatName(string const & type, BufferParams const & bp) const
{
FloatList const & floats = bp.getTextClass().floats();