]> git.lyx.org Git - lyx.git/commitdiff
Properly initialize label font.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 2 Nov 2007 16:34:37 +0000 (16:34 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 2 Nov 2007 16:34:37 +0000 (16:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21378 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp

index 757d4fd8717589c3b188a9cb3097466733f77ba1..b08e20fe446d466f19dda1a6051a6bf4e4a47269 100644 (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();