]> git.lyx.org Git - features.git/commitdiff
inset configurability: ERT
authorMartin Vermeer <martin.vermeer@hut.fi>
Tue, 21 Aug 2007 21:29:13 +0000 (21:29 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Tue, 21 Aug 2007 21:29:13 +0000 (21:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19702 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdinsets.inc
src/insets/InsetERT.cpp

index 4c3af0837b5c1480cf58d367a3e4064524974b69..84fe39369392c781f1df3c827016da1e253359e1 100644 (file)
@@ -75,4 +75,15 @@ InsetLayout Note:Shaded
        EndFont
 End
 
+InsetLayout ERT
+       LabelString           ERT
+       Font
+         Color               latex
+         Family              typewriter
+       EndFont
+       LabelFont
+         Color               latex
+         Size                Small
+       EndFont
+End
 
index c762062005a0090892d849fd223e0b5d87754ab1..3a39b96a748a4036aa7dfdaecc30f8f02f6b1755 100644 (file)
@@ -53,11 +53,7 @@ using std::string;
 void InsetERT::init()
 {
        setButtonLabel();
-       Font font(Font::ALL_SANE);
-       font.decSize();
-       font.decSize();
-       font.setColor(Color::latex);
-       setLabelFont(font);
+       setLabelFont(layout_.labelfont);
        text_.current_font.setLanguage(latex_language);
        text_.real_current_font.setLanguage(latex_language);
 }
@@ -66,6 +62,7 @@ void InsetERT::init()
 InsetERT::InsetERT(BufferParams const & bp, CollapseStatus status)
        : InsetCollapsable(bp, status)
 {
+       setLayout(bp);
        init();
 }
 
@@ -413,6 +410,7 @@ void InsetERT::draw(PainterInfo & pi, int x, int y) const
        Font tmpfont = pi.base.font;
        getDrawFont(pi.base.font);
        pi.base.font.realize(tmpfont);
+       const_cast<InsetERT &>(*this).setButtonLabel();
        InsetCollapsable::draw(pi, x, y);
        pi.base.font = tmpfont;
 }
@@ -428,8 +426,7 @@ bool InsetERT::showInsetDialog(BufferView * bv) const
 void InsetERT::getDrawFont(Font & font) const
 {
        font = Font(Font::ALL_INHERIT, latex_language);
-       font.setFamily(Font::TYPEWRITER_FAMILY);
-       font.setColor(Color::latex);
+       font.realize(layout_.font);
 }