diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index c0a2043003..3510d4bdaa 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -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,7 @@ void InsetBranch::setButtonLabel() s = _("Undef: ") + s; } } - font.setColor(Color::foreground); setLabel(isOpen() ? s : getNewLabel(s) ); - setLabelFont(font); } @@ -139,6 +134,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; } diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 9600c0e9d3..58a7fd5382 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -296,7 +296,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const const_cast(this)->setDrawFrame(true); int desc = InsetText::descent(); - if (status() == Open) + if (geometry() == SubLabel) desc -= ascent(); else desc -= 3; @@ -319,8 +319,8 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const pi.pain.line(x + dim_.wid - 3, y + desc, x + dim_.wid - 3, y + desc - 4, layout_.labelfont.color()); - // the label of the charstyle. Can be toggled. - if (status() == Open) { + // the label below the text. Can be toggled. + if (geometry() == SubLabel) { Font font(layout_.labelfont); font.realize(Font(Font::ALL_SANE)); font.decSize();