]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetBranch.cpp
index 5174f6c7a0705d641893b24031803efb105853c2..e701da599f796e11392c8e32cebcbbbc8f4e8be4 100644 (file)
@@ -46,6 +46,7 @@ InsetBranch::InsetBranch(BufferParams const & bp,
                         InsetBranchParams const & params)
        : InsetCollapsable(bp), params_(params)
 {
+       setLayout(bp);
        init();
 }
 
@@ -86,16 +87,13 @@ void InsetBranch::read(Buffer const & buf, Lexer & lex)
 {
        params_.read(lex);
        InsetCollapsable::read(buf, lex);
+       setLayout(buf.params());
        setButtonLabel();
 }
 
 
 void InsetBranch::setButtonLabel()
 {
-       Font font(Font::ALL_SANE);
-       font.decSize();
-       font.decSize();
-
        docstring s = _("Branch: ") + params_.branch;
        if (!params_.branch.empty()) {
                // FIXME UNICODE
@@ -104,9 +102,10 @@ void InsetBranch::setButtonLabel()
                        s = _("Undef: ") + s;
                }
        }
-       font.setColor(Color::foreground);
-       setLabel(isOpen() ? s : getNewLabel(s) );
-       setLabelFont(font);
+       if (decoration() == Classic)
+               setLabel(isOpen() ? s : getNewLabel(s) );
+       else
+               setLabel(params_.branch + ": " + getNewLabel(s));
 }
 
 
@@ -138,6 +137,7 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
                InsetBranchParams params;
                InsetBranchMailer::string2params(to_utf8(cmd.argument()), params);
                params_.branch = params.branch;
+               setLayout(cur.buffer().params());
                setButtonLabel();
                break;
        }