]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetBranch.cpp
index ce05c362c749d4608bdb801e62f530ebc44f0dcf..e701da599f796e11392c8e32cebcbbbc8f4e8be4 100644 (file)
@@ -31,7 +31,6 @@
 namespace lyx {
 
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -47,6 +46,7 @@ InsetBranch::InsetBranch(BufferParams const & bp,
                         InsetBranchParams const & params)
        : InsetCollapsable(bp), params_(params)
 {
+       setLayout(bp);
        init();
 }
 
@@ -64,9 +64,9 @@ InsetBranch::~InsetBranch()
 }
 
 
-auto_ptr<Inset> InsetBranch::doClone() const
+Inset * InsetBranch::clone() const
 {
-       return auto_ptr<Inset>(new InsetBranch(*this));
+       return new InsetBranch(*this);
 }
 
 
@@ -87,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
@@ -105,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));
 }
 
 
@@ -139,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;
        }