From e0db6e2679edaa85948025b2eae350a4289aa513 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Sat, 1 Sep 2007 17:55:21 +0000 Subject: [PATCH] small cleanup collapsable; label fix branch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19976 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetBranch.cpp | 8 ++------ src/insets/InsetCollapsable.cpp | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) 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(); -- 2.39.2