From: Abdelrazak Younes Date: Fri, 2 Nov 2007 16:34:37 +0000 (+0000) Subject: Properly initialize label font. X-Git-Tag: 1.6.10~7525 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b931f6ab4afa57859ee215125b26fc7f92ab4ef7;p=lyx.git Properly initialize label font. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21378 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 757d4fd871..b08e20fe44 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -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();