small cleanup collapsable; label fix branch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19976 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2007-09-01 17:55:21 +00:00
parent 53299d06f8
commit e0db6e2679
2 changed files with 5 additions and 9 deletions

View File

@ -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;
}

View File

@ -296,7 +296,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
const_cast<InsetCollapsable *>(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();