mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
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:
parent
53299d06f8
commit
e0db6e2679
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user